diff --git a/Sources/CasePaths/EnumReflection.swift b/Sources/CasePaths/EnumReflection.swift index 38db4124..8d93009d 100644 --- a/Sources/CasePaths/EnumReflection.swift +++ b/Sources/CasePaths/EnumReflection.swift @@ -14,18 +14,17 @@ extension AnyCasePath { @available(macOS, deprecated: 9999, message: "Use a 'CasePathable' case key path, instead") @available(tvOS, deprecated: 9999, message: "Use a 'CasePathable' case key path, instead") @available(watchOS, deprecated: 9999, message: "Use a 'CasePathable' case key path, instead") - public init(unsafe embed: @escaping @Sendable (Value) -> Root) { - func open(_: Wrapped.Type) -> @Sendable (Root) -> Value? { - optionalPromotedExtractHelp(unsafeBitCast(embed, to: (@Sendable (Value) -> Wrapped?).self)) - as! @Sendable (Root) -> Value? + public init(unsafe embed: @escaping (Value) -> Root) { + func open(_: Wrapped.Type) -> (Root) -> Value? { + optionalPromotedExtractHelp(unsafeBitCast(embed, to: ((Value) -> Wrapped?).self)) + as! (Root) -> Value? } - @UncheckedSendable var embed = embed let extract = ((_Witness.self as? _AnyOptional.Type)?.wrappedType) .map { _openExistential($0, do: open) } - ?? extractHelp { [$embed] in $embed.wrappedValue($0) } + ?? extractHelp(embed) self.init( - embed: { [$embed] in $embed.wrappedValue($0) }, + embed: embed, extract: extract ) } @@ -39,11 +38,11 @@ extension AnyCasePath { @available(tvOS, deprecated: 9999, message: "Use a 'CasePathable' case key path, instead") @available(watchOS, deprecated: 9999, message: "Use a 'CasePathable' case key path, instead") @_disfavoredOverload - public init(unsafe root: @autoclosure @escaping @Sendable () -> Root) where Value == Void { - func open(_: Wrapped.Type) -> @Sendable (Root) -> Void? { + public init(unsafe root: @autoclosure @escaping () -> Root) where Value == Void { + func open(_: Wrapped.Type) -> (Root) -> Void? { optionalPromotedExtractVoidHelp( unsafeBitCast(root, to: Wrapped?.self) - ) as! @Sendable (Root) -> Void? + ) as! (Root) -> Void? } let extract = ((_Witness.self as? _AnyOptional.Type)?.wrappedType) @@ -61,8 +60,8 @@ private struct Cache: Sendable { } func extractHelp( - _ embed: @escaping @Sendable (Value) -> Root -) -> @Sendable (Root) -> Value? { + _ embed: @escaping (Value) -> Root +) -> (Root) -> Value? { guard let metadata = EnumMetadata(Root.self), metadata.typeDescriptor.fieldDescriptor != nil @@ -106,8 +105,8 @@ func extractHelp( } func optionalPromotedExtractHelp( - _ embed: @escaping @Sendable (Value) -> Root? -) -> @Sendable (Root?) -> Value? { + _ embed: @escaping (Value) -> Root? +) -> (Root?) -> Value? { guard Root.self != Value.self else { return { $0 as! Value? } } guard let metadata = EnumMetadata(Root.self), @@ -138,7 +137,7 @@ func optionalPromotedExtractHelp( } } -func extractVoidHelp(_ root: Root) -> @Sendable (Root) -> Void? { +func extractVoidHelp(_ root: Root) -> (Root) -> Void? { guard let metadata = EnumMetadata(Root.self), metadata.typeDescriptor.fieldDescriptor != nil @@ -151,7 +150,7 @@ func extractVoidHelp(_ root: Root) -> @Sendable (Root) -> Void? { return { root in metadata.tag(of: root) == cachedTag ? () : nil } } -func optionalPromotedExtractVoidHelp(_ root: Root?) -> @Sendable (Root?) -> Void? { +func optionalPromotedExtractVoidHelp(_ root: Root?) -> (Root?) -> Void? { guard let root = root, let metadata = EnumMetadata(Root.self), diff --git a/Sources/CasePaths/Internal/Deprecations.swift b/Sources/CasePaths/Internal/Deprecations.swift index 16e839f8..46b99bfa 100644 --- a/Sources/CasePaths/Internal/Deprecations.swift +++ b/Sources/CasePaths/Internal/Deprecations.swift @@ -81,15 +81,14 @@ extension Optional: _OptionalProtocol { extension AnyCasePath { @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") public init(_ embed: @escaping (Value) -> Root) { - @UncheckedSendable var embed = embed - self.init(unsafe: { [$embed] in $embed.wrappedValue($0) }) + self.init(unsafe: embed) } } extension AnyCasePath where Value == Void { @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") @_disfavoredOverload - public init(_ root: @autoclosure @escaping @Sendable () -> Root) { + public init(_ root: @autoclosure @escaping () -> Root) { self.init(unsafe: root()) } } @@ -116,10 +115,9 @@ extension AnyCasePath { public prefix func / ( embed: @escaping (Value) -> Root ) -> AnyCasePath { - @UncheckedSendable var embed = embed - return AnyCasePath( - embed: { [$embed] in $embed.wrappedValue($0) }, - extract: { [$embed] in extractHelp { $embed.wrappedValue($0) }($0) } + AnyCasePath( + embed: embed, + extract: { extractHelp(embed)($0) } ) } @@ -128,27 +126,26 @@ public prefix func / ( public prefix func / ( embed: @escaping (Value) -> Root? ) -> AnyCasePath { - @UncheckedSendable var embed = embed - return AnyCasePath( - embed: { [$embed] in $embed.wrappedValue($0) }, - extract: optionalPromotedExtractHelp { [$embed] in $embed.wrappedValue($0) } + AnyCasePath( + embed: embed, + extract: optionalPromotedExtractHelp(embed) ) } @_documentation(visibility: internal) @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") public prefix func / ( - root: @autoclosure @escaping @Sendable () -> Root + root: @autoclosure @escaping () -> Root ) -> AnyCasePath { - .init(embed: root, extract: extractVoidHelp(root())) + AnyCasePath(embed: root, extract: extractVoidHelp(root())) } @_documentation(visibility: internal) @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") public prefix func / ( - root: @autoclosure @escaping @Sendable () -> Root? + root: @autoclosure @escaping () -> Root? ) -> AnyCasePath { - .init(embed: root, extract: optionalPromotedExtractVoidHelp(root())) + AnyCasePath(embed: root, extract: optionalPromotedExtractVoidHelp(root())) } @_documentation(visibility: internal) @@ -195,7 +192,7 @@ public prefix func / ( *, deprecated, message: "Use a 'CasePathable' case property via dynamic member lookup, instead" ) public prefix func / ( - root: @autoclosure @escaping @Sendable () -> Root + root: @autoclosure @escaping () -> Root ) -> (Root) -> Void? { (/root).extract(from:) } @@ -206,7 +203,7 @@ public prefix func / ( *, deprecated, message: "Use a 'CasePathable' case property via dynamic member lookup, instead" ) public prefix func / ( - root: @autoclosure @escaping @Sendable () -> Root + root: @autoclosure @escaping () -> Root ) -> (Root?) -> Void? { (/root).extract(from:) } @@ -315,8 +312,8 @@ extension AnyCasePath where Root == Void { /// - Parameter value: A constant value. /// - Returns: A case path from `()` to `value`. @available(*, deprecated) - public static func constant(_ value: @autoclosure @escaping @Sendable () -> Value) -> Self { - .init( + public static func constant(_ value: @autoclosure @escaping () -> Value) -> Self { + AnyCasePath( embed: { _ in () }, extract: { .some(value()) } ) @@ -328,8 +325,8 @@ extension AnyCasePath where Value == Never { /// uninhabited `Never` type. @available(*, deprecated) public static var never: Self { - @Sendable func absurd(_ never: Never) -> A {} - return .init( + func absurd(_ never: Never) -> A {} + return AnyCasePath( embed: absurd, extract: { _ in nil } ) @@ -370,7 +367,7 @@ extension AnyCasePath { /// - Parameter embed: An enum case initializer. /// - Returns: A case path that extracts associated values from enum cases. @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") - public static func `case`(_ embed: @escaping @Sendable (Value) -> Root) -> Self { + public static func `case`(_ embed: @escaping (Value) -> Root) -> Self { self.init( embed: embed, extract: { CasePaths.extract(embed)($0) } @@ -387,7 +384,7 @@ extension AnyCasePath where Value == Void { /// - Parameter value: An enum case with no associated values. /// - Returns: A case path that extracts `()` if the case matches, otherwise `nil`. @available(*, deprecated, message: "Use a 'CasePathable' case key path, instead") - public static func `case`(_ value: @autoclosure @escaping @Sendable () -> Root) -> Self { + public static func `case`(_ value: @autoclosure @escaping () -> Root) -> Self { Self( embed: value, extract: extractVoidHelp(value()) @@ -413,7 +410,7 @@ extension AnyCasePath where Value == Void { /// otherwise `nil`. @available(*, deprecated, message: "Use a '@CasePathable' case property, instead") public func extract( - case embed: @escaping @Sendable (Value) -> Root, + case embed: @escaping (Value) -> Root, from root: Root ) -> Value? { CasePaths.extract(embed)(root) @@ -437,7 +434,7 @@ public func extract( /// otherwise `nil`. @available(*, deprecated, message: "Use a '@CasePathable' case property, instead") public func extract( - case embed: @escaping @Sendable (Value) -> Root?, + case embed: @escaping (Value) -> Root?, from root: Root? ) -> Value? { CasePaths.extract(embed)(root) @@ -460,7 +457,7 @@ public func extract( /// - Parameter embed: An enum case initializer. /// - Returns: A function that can attempt to extract associated values from an enum. @available(*, deprecated, message: "Use a '@CasePathable' case property, instead") -public func extract(_ embed: @escaping @Sendable (Value) -> Root) -> (Root) -> Value? { +public func extract(_ embed: @escaping (Value) -> Root) -> (Root) -> Value? { extractHelp(embed) } @@ -482,7 +479,7 @@ public func extract(_ embed: @escaping @Sendable (Value) -> Root) - /// - Returns: A function that can attempt to extract associated values from an enum. @available(*, deprecated, message: "Use a '@CasePathable' case property, instead") public func extract( - _ embed: @escaping @Sendable (Value) -> Root? -) -> @Sendable (Root?) -> Value? { + _ embed: @escaping (Value) -> Root? +) -> (Root?) -> Value? { optionalPromotedExtractHelp(embed) } diff --git a/Sources/CasePaths/Macros.swift b/Sources/CasePaths/Macros.swift index aa4d424b..4f706199 100644 --- a/Sources/CasePaths/Macros.swift +++ b/Sources/CasePaths/Macros.swift @@ -26,7 +26,14 @@ /// \UserAction.Cases.settings // CasePath /// ``` @attached(extension, conformances: CasePathable, CasePathIterable) -@attached(member, names: named(AllCasePaths), named(allCasePaths), named(_$Element)) +@attached( + member, + conformances: CasePathable, + CasePathIterable, + names: named(AllCasePaths), + named(allCasePaths), + named(_$Element) +) public macro CasePathable() = #externalMacro( module: "CasePathsMacros", type: "CasePathableMacro" diff --git a/Sources/CasePathsCore/AnyCasePath.swift b/Sources/CasePathsCore/AnyCasePath.swift index 30ea95d2..a7d53e91 100644 --- a/Sources/CasePathsCore/AnyCasePath.swift +++ b/Sources/CasePathsCore/AnyCasePath.swift @@ -6,9 +6,9 @@ import Foundation /// This type defines key path-like semantics for enum cases, and is used to derive ``CaseKeyPath``s /// from types that conform to ``CasePathable``. @dynamicMemberLookup -public struct AnyCasePath: Sendable { - private let _embed: @Sendable (Value) -> Root - private let _extract: @Sendable (Root) -> Value? +public struct AnyCasePath { + private let _embed: (Value) -> Root + private let _extract: (Root) -> Value? /// Creates a type-erased case path from a pair of functions. /// @@ -16,26 +16,13 @@ public struct AnyCasePath: Sendable { /// - embed: A function that always succeeds in embedding a value in a root. /// - extract: A function that can optionally fail in extracting a value from a root. public init( - embed: @escaping @Sendable (Value) -> Root, - extract: @escaping @Sendable (Root) -> Value? + embed: @escaping (Value) -> Root, + extract: @escaping (Root) -> Value? ) { self._embed = embed self._extract = extract } - public static func _$embed( - _ embed: @escaping (Value) -> Root, - extract: @escaping @Sendable (Root) -> Value? - ) -> Self { - #if swift(>=5.10) - nonisolated(unsafe) let embed = embed - return Self(embed: { embed($0) }, extract: extract) - #else - @UncheckedSendable var embed = embed - return Self(embed: { [$embed] in $embed.wrappedValue($0) }, extract: extract) - #endif - } - /// Returns a root by embedding a value. /// /// - Parameter value: A value to embed. diff --git a/Sources/CasePathsCore/CasePathable.swift b/Sources/CasePathsCore/CasePathable.swift index a4565118..669ba5bc 100644 --- a/Sources/CasePathsCore/CasePathable.swift +++ b/Sources/CasePathsCore/CasePathable.swift @@ -46,18 +46,18 @@ public protocol CasePathable { /// associated value types. @_documentation(visibility: internal) @dynamicMemberLookup -public struct Case: Sendable { - fileprivate let _embed: @Sendable (Value) -> Any - fileprivate let _extract: @Sendable (Any) -> Value? +public struct Case { + fileprivate let _embed: (Value) -> Any + fileprivate let _extract: (Any) -> Value? } extension Case { public init( - embed: @escaping @Sendable (Value) -> Root, - extract: @escaping @Sendable (Root) -> Value? + embed: @escaping (Value) -> Root, + extract: @escaping (Root) -> Value? ) { self._embed = embed - self._extract = { @Sendable in ($0 as? Root).flatMap(extract) } + self._extract = { ($0 as? Root).flatMap(extract) } } public init() { @@ -72,14 +72,9 @@ extension Case { dynamicMember keyPath: KeyPath> ) -> Case where Value: CasePathable { - let keyPath = keyPath.unsafeSendable() - return Case( - embed: { - _embed(Value.allCasePaths[keyPath: keyPath].embed($0)) - }, - extract: { - _extract(from: $0).flatMap(Value.allCasePaths[keyPath: keyPath].extract) - } + Case( + embed: { _embed(Value.allCasePaths[keyPath: keyPath].embed($0)) }, + extract: { _extract(from: $0).flatMap(Value.allCasePaths[keyPath: keyPath].extract) } ) } @@ -516,16 +511,9 @@ extension AnyCasePath where Value: CasePathable { public subscript( dynamicMember keyPath: KeyPath> ) -> AnyCasePath { - let keyPath = keyPath.unsafeSendable() - return AnyCasePath( - embed: { - embed(Value.allCasePaths[keyPath: keyPath].embed($0)) - }, - extract: { - extract(from: $0).flatMap( - Value.allCasePaths[keyPath: keyPath].extract(from:) - ) - } + AnyCasePath( + embed: { embed(Value.allCasePaths[keyPath: keyPath].embed($0)) }, + extract: { extract(from: $0).flatMap(Value.allCasePaths[keyPath: keyPath].extract(from:)) } ) } } diff --git a/Sources/CasePathsCore/Internal/KeyPath+Sendable.swift b/Sources/CasePathsCore/Internal/KeyPath+Sendable.swift deleted file mode 100644 index 87bd30e2..00000000 --- a/Sources/CasePathsCore/Internal/KeyPath+Sendable.swift +++ /dev/null @@ -1,22 +0,0 @@ -#if compiler(>=6) - public typealias _SendableKeyPath = any Sendable & KeyPath -#else - public typealias _SendableKeyPath = KeyPath -#endif - -// NB: Dynamic member lookup does not currently support sendable key paths and even breaks -// autocomplete. -// -// * https://github.com/swiftlang/swift/issues/77035 -// * https://github.com/swiftlang/swift/issues/77105 -extension _AppendKeyPath { - @_transparent - package func unsafeSendable() -> _SendableKeyPath - where Self == KeyPath { - #if compiler(>=6) - unsafeBitCast(self, to: _SendableKeyPath.self) - #else - self - #endif - } -} diff --git a/Sources/CasePathsCore/Internal/UncheckedSendable.swift b/Sources/CasePathsCore/Internal/UncheckedSendable.swift deleted file mode 100644 index 9793ddcc..00000000 --- a/Sources/CasePathsCore/Internal/UncheckedSendable.swift +++ /dev/null @@ -1,8 +0,0 @@ -@propertyWrapper -package struct UncheckedSendable: @unchecked Sendable { - package var wrappedValue: Value - package init(wrappedValue value: Value) { - self.wrappedValue = value - } - package var projectedValue: Self { self } -} diff --git a/Sources/CasePathsCore/Never+CasePathable.swift b/Sources/CasePathsCore/Never+CasePathable.swift index 0bf6b090..f071e697 100644 --- a/Sources/CasePathsCore/Never+CasePathable.swift +++ b/Sources/CasePathsCore/Never+CasePathable.swift @@ -16,7 +16,7 @@ extension Case where Value: CasePathable { /// This property can chain any case path into a `Never` value, which, as an uninhabited type, /// cannot be embedded nor extracted from an enum. public var never: Case { - @Sendable func absurd(_: Never) -> T {} + func absurd(_: Never) -> T {} return Case(embed: absurd, extract: { (_: Value) in nil }) } } @@ -24,7 +24,7 @@ extension Case where Value: CasePathable { extension Case { @available(*, deprecated, message: "This enum must be '@CasePathable' to enable key path syntax") public var never: Case { - @Sendable func absurd(_: Never) -> T {} + func absurd(_: Never) -> T {} return Case(embed: absurd, extract: { (_: Value) in nil }) } } diff --git a/Sources/CasePathsMacros/CasePathableMacro.swift b/Sources/CasePathsMacros/CasePathableMacro.swift index c12891cd..3948e98d 100644 --- a/Sources/CasePathsMacros/CasePathableMacro.swift +++ b/Sources/CasePathsMacros/CasePathableMacro.swift @@ -25,16 +25,21 @@ extension CasePathableMacro: ExtensionMacro { return [] } var conformances: [String] = [] + #if compiler(>=6.2) + let nonisolated = nonisolated?.description ?? "" + #else + let nonisolated = "" + #endif if let inheritanceClause = enumDecl.inheritanceClause { for type in ["CasePathable", "CasePathIterable"] { if !inheritanceClause.inheritedTypes.contains(where: { [type, type.qualified].contains($0.type.trimmedDescription) }) { - conformances.append("\(moduleName).\(type)") + conformances.append("\(nonisolated)\(moduleName).\(type)") } } } else { - conformances = ["CasePathable", "CasePathIterable"].qualified + conformances = ["CasePathable", "CasePathIterable"].qualified.map { "\(nonisolated)\($0)" } } guard !conformances.isEmpty else { return [] } return [ @@ -56,6 +61,17 @@ extension CasePathableMacro: MemberMacro { of node: AttributeSyntax, providingMembersOf declaration: Declaration, in context: Context + ) throws -> [DeclSyntax] { + try expansion(of: node, providingMembersOf: declaration, conformingTo: [], in: context) + } + + public static func expansion< + Declaration: DeclGroupSyntax, Context: MacroExpansionContext + >( + of node: AttributeSyntax, + providingMembersOf declaration: Declaration, + conformingTo protocols: [TypeSyntax], + in context: Context ) throws -> [DeclSyntax] { guard let enumDecl = declaration.as(EnumDeclSyntax.self) else { @@ -105,7 +121,8 @@ extension CasePathableMacro: MemberMacro { var decls: [DeclSyntax] = [ """ - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public \(nonisolated)struct AllCasePaths: \ + CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: \(enumName)) -> CasePaths.PartialCaseKeyPath<\(enumName)> { \(raw: rootSubscriptCases.map { "\($0.description)\n" }.joined())\(raw: subscriptReturn) } @@ -119,7 +136,7 @@ extension CasePathableMacro: MemberMacro { } """, """ - public static var allCasePaths: AllCasePaths { AllCasePaths() } + public \(nonisolated)static var allCasePaths: AllCasePaths { AllCasePaths() } """, ] @@ -219,7 +236,7 @@ extension CasePathableMacro: MemberMacro { return """ \(raw: leadingTrivia)public var \(caseName): \ \(raw: casePathTypeName.qualified)<\(enumName), \(raw: associatedValueName)> { - ._$embed(\(raw: embed)) { + \(raw: casePathTypeName.qualified)(embed: \(raw: embed)) { guard case\(raw: hasPayload ? " let" : "").\(caseName)\(raw: bindingNames) = $0 else { \ return nil \ } diff --git a/Sources/CasePathsMacros/Internal/Nonisolated.swift b/Sources/CasePathsMacros/Internal/Nonisolated.swift new file mode 100644 index 00000000..34060de1 --- /dev/null +++ b/Sources/CasePathsMacros/Internal/Nonisolated.swift @@ -0,0 +1,9 @@ +import SwiftSyntax + +var nonisolated: TokenSyntax? { + #if compiler(>=6.1) + .keyword(.nonisolated, trailingTrivia: .space) + #else + nil + #endif +} diff --git a/Tests/CasePathsMacrosTests/CasePathableMacroTests.swift b/Tests/CasePathsMacrosTests/CasePathableMacroTests.swift index 2306a3f5..6b1646f7 100644 --- a/Tests/CasePathsMacrosTests/CasePathableMacroTests.swift +++ b/Tests/CasePathsMacrosTests/CasePathableMacroTests.swift @@ -1,4 +1,4 @@ -#if canImport(MacroTesting) +#if canImport(MacroTesting) && swift(>=6.2) import CasePathsMacros import MacroTesting import SwiftSyntaxMacros @@ -32,7 +32,7 @@ case fizz(buzz: String) case fizzier(Int, buzzier: String) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -49,7 +49,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -59,7 +59,7 @@ } } public var baz: CasePaths.AnyCasePath { - ._$embed(Foo.baz) { + CasePaths.AnyCasePath(embed: Foo.baz) { guard case let .baz(v0) = $0 else { return nil } @@ -67,7 +67,7 @@ } } public var fizz: CasePaths.AnyCasePath { - ._$embed(Foo.fizz) { + CasePaths.AnyCasePath(embed: Foo.fizz) { guard case let .fizz(v0) = $0 else { return nil } @@ -75,7 +75,7 @@ } } public var fizzier: CasePaths.AnyCasePath { - ._$embed(Foo.fizzier) { + CasePaths.AnyCasePath(embed: Foo.fizzier) { guard case let .fizzier(v0, v1) = $0 else { return nil } @@ -92,12 +92,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -112,7 +112,7 @@ #""" enum EnumWithNoCases { - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: EnumWithNoCases) -> CasePaths.PartialCaseKeyPath { \.never } @@ -123,12 +123,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension EnumWithNoCases: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension EnumWithNoCases: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -146,7 +146,7 @@ enum Foo { case bar(Never) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -154,7 +154,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -168,12 +168,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -191,7 +191,7 @@ public enum Foo { case bar(Int), baz(String) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -202,7 +202,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -210,7 +210,7 @@ } } public var baz: CasePaths.AnyCasePath { - ._$embed(Foo.baz) { + CasePaths.AnyCasePath(embed: Foo.baz) { guard case let .baz(v0) = $0 else { return nil } @@ -225,12 +225,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -248,7 +248,7 @@ public enum Foo { case bar(Int) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -256,7 +256,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -270,12 +270,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -290,7 +290,7 @@ package enum Foo { case bar(Int) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -298,7 +298,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -312,12 +312,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -332,7 +332,7 @@ private enum Foo { case bar(Int) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -340,7 +340,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -354,12 +354,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -411,7 +411,7 @@ #""" enum Foo: CasePathable { - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { \.never } @@ -422,12 +422,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathIterable { } """# } @@ -440,7 +440,7 @@ #""" enum Foo: CasePaths.CasePathable { - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { \.never } @@ -451,12 +451,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathIterable { } """# } @@ -474,7 +474,7 @@ enum Foo { case bar(_ int: Int, _ bool: Bool) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -482,7 +482,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0, v1) = $0 else { return nil } @@ -496,12 +496,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -519,7 +519,7 @@ enum Foo { case bar(Bar) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -527,7 +527,7 @@ return \.never } public var bar: CasePaths.AnyCasePath> { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0) = $0 else { return nil } @@ -541,12 +541,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -564,7 +564,7 @@ enum Foo { case bar(int: Int = 42, bool: Bool = true) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -572,7 +572,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed(Foo.bar) { + CasePaths.AnyCasePath(embed: Foo.bar) { guard case let .bar(v0, v1) = $0 else { return nil } @@ -586,12 +586,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -643,7 +643,7 @@ #endif #endif - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -680,7 +680,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -691,7 +691,7 @@ } #if os(macOS) public var macCase: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.macCase }) { guard case .macCase = $0 else { @@ -701,7 +701,7 @@ } } public var macSecond: CasePaths.AnyCasePath { - ._$embed(Foo.macSecond) { + CasePaths.AnyCasePath(embed: Foo.macSecond) { guard case let .macSecond(v0) = $0 else { return nil } @@ -710,7 +710,7 @@ } #elseif os(iOS) public var iosCase: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.iosCase }) { guard case .iosCase = $0 else { @@ -721,7 +721,7 @@ } #else public var elseCase: CasePaths.AnyCasePath { - ._$embed(Foo.elseCase) { + CasePaths.AnyCasePath(embed: Foo.elseCase) { guard case let .elseCase(v0) = $0 else { return nil } @@ -729,7 +729,7 @@ } } public var elseLast: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.elseLast }) { guard case .elseLast = $0 else { @@ -742,7 +742,7 @@ #if DEBUG #if INNER public var twoLevelsDeep: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.twoLevelsDeep }) { guard case .twoLevelsDeep = $0 else { @@ -752,7 +752,7 @@ } } public var twoLevels: CasePaths.AnyCasePath { - ._$embed(Foo.twoLevels) { + CasePaths.AnyCasePath(embed: Foo.twoLevels) { guard case let .twoLevels(v0) = $0 else { return nil } @@ -783,12 +783,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -809,7 +809,7 @@ enum Foo { case bar - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -817,7 +817,7 @@ return \.never } public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -833,12 +833,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - @available(iOS, unavailable) extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + @available(iOS, unavailable) extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -885,7 +885,7 @@ */ case fizz, buzz - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -903,7 +903,7 @@ } /// The bar case. public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -916,7 +916,7 @@ /// /// A case for baz. public var baz: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.baz }) { guard case .baz = $0 else { @@ -931,7 +931,7 @@ A case for fizz and buzz. */ public var fizz: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.fizz }) { guard case .fizz = $0 else { @@ -946,7 +946,7 @@ A case for fizz and buzz. */ public var buzz: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.buzz }) { guard case .buzz = $0 else { @@ -965,12 +965,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -993,7 +993,7 @@ // case foo case bar - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -1003,7 +1003,7 @@ // baz // case foo public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -1019,12 +1019,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1052,7 +1052,7 @@ case fizzier/*Comment in case*/(Int, buzzier: String) case fizziest // Comment without associated value - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Foo) -> CasePaths.PartialCaseKeyPath { if root.is(\.bar) { return \.bar @@ -1073,7 +1073,7 @@ } // Comment above case public var bar: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.bar }) { guard case .bar = $0 else { @@ -1083,7 +1083,7 @@ } } /*Comment before case*/public var baz: CasePaths.AnyCasePath { - ._$embed(Foo.baz) { + CasePaths.AnyCasePath(embed: Foo.baz) { guard case let .baz(v0) = $0 else { return nil } @@ -1091,7 +1091,7 @@ } } public var fizz: CasePaths.AnyCasePath { - ._$embed(Foo.fizz) { + CasePaths.AnyCasePath(embed: Foo.fizz) { guard case let .fizz(v0) = $0 else { return nil } @@ -1099,7 +1099,7 @@ } } public var fizzier: CasePaths.AnyCasePath { - ._$embed(Foo.fizzier) { + CasePaths.AnyCasePath(embed: Foo.fizzier) { guard case let .fizzier(v0, v1) = $0 else { return nil } @@ -1107,7 +1107,7 @@ } } public var fizziest: CasePaths.AnyCasePath { - ._$embed({ + CasePaths.AnyCasePath(embed: { Foo.fizziest }) { guard case .fizziest = $0 else { @@ -1127,12 +1127,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Foo: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Foo: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1150,7 +1150,7 @@ enum Action { case element(Element) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Action) -> CasePaths.PartialCaseKeyPath { if root.is(\.element) { return \.element @@ -1158,7 +1158,7 @@ return \.never } public var element: CasePaths.AnyCasePath { - ._$embed(Action.element) { + CasePaths.AnyCasePath(embed: Action.element) { guard case let .element(v0) = $0 else { return nil } @@ -1172,14 +1172,14 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } public typealias _$Element = Element } - extension Action: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Action: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1200,7 +1200,7 @@ enum Action { case element(Element) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Action) -> CasePaths.PartialCaseKeyPath { if root.is(\.element) { return \.element @@ -1208,7 +1208,7 @@ return \.never } public var element: CasePaths.AnyCasePath { - ._$embed(Action.element) { + CasePaths.AnyCasePath(embed: Action.element) { guard case let .element(v0) = $0 else { return nil } @@ -1222,7 +1222,7 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } @@ -1230,7 +1230,7 @@ } } - extension Reducer.Action: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Reducer.Action: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1248,7 +1248,7 @@ enum Action { case element(Array) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Action) -> CasePaths.PartialCaseKeyPath { if root.is(\.element) { return \.element @@ -1256,7 +1256,7 @@ return \.never } public var element: CasePaths.AnyCasePath> { - ._$embed(Action.element) { + CasePaths.AnyCasePath(embed: Action.element) { guard case let .element(v0) = $0 else { return nil } @@ -1270,14 +1270,14 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } public typealias _$Element = Element } - extension Action: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Action: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1299,7 +1299,7 @@ case secondElement(Element) case thirdElement(Element, Element, Int) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Action) -> CasePaths.PartialCaseKeyPath { if root.is(\.element) { return \.element @@ -1313,7 +1313,7 @@ return \.never } public var element: CasePaths.AnyCasePath> { - ._$embed(Action.element) { + CasePaths.AnyCasePath(embed: Action.element) { guard case let .element(v0) = $0 else { return nil } @@ -1321,7 +1321,7 @@ } } public var secondElement: CasePaths.AnyCasePath { - ._$embed(Action.secondElement) { + CasePaths.AnyCasePath(embed: Action.secondElement) { guard case let .secondElement(v0) = $0 else { return nil } @@ -1329,7 +1329,7 @@ } } public var thirdElement: CasePaths.AnyCasePath { - ._$embed(Action.thirdElement) { + CasePaths.AnyCasePath(embed: Action.thirdElement) { guard case let .thirdElement(v0, v1, v2) = $0 else { return nil } @@ -1345,14 +1345,14 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } public typealias _$Element = Element } - extension Action: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Action: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } @@ -1394,7 +1394,7 @@ third: Double, ) - public struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { + public nonisolated struct AllCasePaths: CasePaths.CasePathReflectable, Swift.Sendable, Swift.Sequence { public subscript(root: Action) -> CasePaths.PartialCaseKeyPath { if root.is(\.exampleAction) { return \.exampleAction @@ -1410,7 +1410,7 @@ public var exampleAction: CasePaths.AnyCasePath { - ._$embed(Action.exampleAction) { + CasePaths.AnyCasePath(embed: Action.exampleAction) { guard case let .exampleAction(v0, v1, v2) = $0 else { return nil } @@ -1418,7 +1418,7 @@ } } public var singleParam: CasePaths.AnyCasePath { - ._$embed(Action.singleParam) { + CasePaths.AnyCasePath(embed: Action.singleParam) { guard case let .singleParam(v0) = $0 else { return nil } @@ -1428,7 +1428,7 @@ public var multipleWithLabels: CasePaths.AnyCasePath { - ._$embed(Action.multipleWithLabels) { + CasePaths.AnyCasePath(embed: Action.multipleWithLabels) { guard case let .multipleWithLabels(v0, v1, v2) = $0 else { return nil } @@ -1444,12 +1444,12 @@ } } - public static var allCasePaths: AllCasePaths { + public nonisolated static var allCasePaths: AllCasePaths { AllCasePaths() } } - extension Action: CasePaths.CasePathable, CasePaths.CasePathIterable { + extension Action: nonisolated CasePaths.CasePathable, nonisolated CasePaths.CasePathIterable { } """# } diff --git a/Tests/CasePathsTests/CaseSetTests.swift b/Tests/CasePathsTests/CaseSetTests.swift index 6d754a52..af23e630 100644 --- a/Tests/CasePathsTests/CaseSetTests.swift +++ b/Tests/CasePathsTests/CaseSetTests.swift @@ -155,13 +155,13 @@ public subscript( dynamicMember keyPath: CaseKeyPath // & Sendable ) -> CaseSetBuilder { - CaseSetBuilder(set: self, keyPath: keyPath.unsafeSendable()) + CaseSetBuilder(set: self, keyPath: keyPath) } } public struct CaseSetBuilder { let set: CaseSet - let keyPath: CaseKeyPath & Sendable + let keyPath: CaseKeyPath public func callAsFunction(_ value: Value?) -> CaseSet { var set = set diff --git a/Tests/CasePathsTests/DeprecatedTests.swift b/Tests/CasePathsTests/DeprecatedTests.swift index c6fb4230..89f246c5 100644 --- a/Tests/CasePathsTests/DeprecatedTests.swift +++ b/Tests/CasePathsTests/DeprecatedTests.swift @@ -1225,7 +1225,7 @@ final class DeprecatedTests: XCTestCase { #if os(Windows) || arch(wasm32) // There seems to be some strangeness with the current - // concurrency implmentation on Windows that breaks if + // concurrency implementation on Windows that breaks if // you have more than 100 tasks here. // WebAssembly doesn't support tail-call for now, so we // have smaller limit as well. @@ -1234,18 +1234,18 @@ final class DeprecatedTests: XCTestCase { let maxIterations = 100_000 #endif - func testConcurrency_SharedCasePath() async throws { - enum Enum { case payload(Int) } - let casePath = /Enum.payload - - await withTaskGroup(of: Void.self) { group in - for index in 1...maxIterations { - group.addTask { - XCTAssertEqual(casePath.extract(from: Enum.payload(index)), index) - } - } - } - } + // func testConcurrency_SharedCasePath() async throws { + // enum Enum { case payload(Int) } + // nonisolated(unsafe) let casePath = /Enum.payload + // + // await withTaskGroup(of: Void.self) { group in + // for index in 1...maxIterations { + // group.addTask { + // XCTAssertEqual(casePath.extract(from: Enum.payload(index)), index) + // } + // } + // } + // } } private class TestObject: Equatable { diff --git a/Tests/CasePathsTests/XCTModifyTests.swift b/Tests/CasePathsTests/XCTModifyTests.swift index a86c6e32..6fd87ae3 100644 --- a/Tests/CasePathsTests/XCTModifyTests.swift +++ b/Tests/CasePathsTests/XCTModifyTests.swift @@ -2,6 +2,7 @@ @_spi(Internals) import CasePaths import XCTest + @available(*, deprecated) final class XCTModifyTests: XCTestCase { struct SomeError: Error, Equatable {}