Skip to content

Update remaining Predicate tests to use the #Predicate macro #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ let package = Package(
name: "FoundationEssentials",
dependencies: [
"_CShims",
"FoundationMacros",
.product(name: "_RopeModule", package: "swift-collections"),
],
swiftSettings: [
Expand Down Expand Up @@ -117,10 +118,3 @@ package.targets.append(contentsOf: [
], swiftSettings: availabilityMacros),
])
#endif

#if !os(Windows)
// Using macros at build-time is not yet supported on Windows
if let index = package.targets.firstIndex(where: { $0.name == "FoundationEssentials" }) {
package.targets[index].dependencies.append("FoundationMacros")
}
#endif
2 changes: 0 additions & 2 deletions Sources/FoundationEssentials/Predicate/Predicate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public struct Predicate<each Input> : Sendable {
}
}

#if compiler(>=5.9) && !os(Windows)
@freestanding(expression)
@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
public macro Predicate<each Input>(_ body: (repeat each Input) -> Bool) -> Predicate<repeat each Input> = #externalMacro(module: "FoundationMacros", type: "PredicateMacro")
#endif

@available(macOS 14, iOS 17, tvOS 17, watchOS 10, *)
extension Predicate {
Expand Down
Loading