Avatar
Avatar
norio_nomura
Swift 5.9.1で@OptionSetがstdlibに追加されて、その後しれっと削除された様なのですが、SwiftMacro内には存在し続けて配布が続いている様です。これってどういう扱いになってるのでしょう? @swift-5.9.2 @swift-5.10 -Xfrontend -print-ast-decl @attached(member, names: named(RawValue), named(rawValue), named(`init`), arbitrary) @attached(extension, conformances: OptionSet) public macro OptionSet<RawType>() = #externalMacro(module: "SwiftMacros", type: "OptionSetMacro") @OptionSet<UInt8> struct ShippingOptions { private enum Options: Int { case nextDay case secondDay case priority case standard } static let express: ShippingOptions = [.nextDay, .secondDay] static let all: ShippingOptions = [.express, .priority, .standard] } struct ShippingOptionsWithNoMacro { private enum Options: Int { case nextDay case secondDay case priority case standard } static let express: ShippingOptions = [.nextDay, .secondDay] static let all: ShippingOptions = [.express, .priority, .standard] }
@attached(member, names: named(RawValue), named(rawValue), named(`init`), arbitrary) @attached(extension, conformances: OptionSet) public macro OptionSet<RawType>() = #externalMacro(module: "SwiftMacros", type: "OptionSetMacro") internal struct ShippingOptions {
1.36 KB