[Macros] Allow @attached(extension) attributes to be suppressed in

module interfaces.
This commit is contained in:
Holly Borla
2023-06-28 14:53:16 -07:00
parent c3bdae6a30
commit 81a1f64811
5 changed files with 35 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t/Macros.swiftinterface) -module-name Macros %s
// RUN: %target-swift-emit-module-interface(%t/Macros.swiftinterface) -enable-experimental-feature ExtensionMacros -module-name Macros %s
// RUN: %FileCheck %s < %t/Macros.swiftinterface --check-prefix CHECK
// RUN: %target-swift-frontend -compile-module-from-interface %t/Macros.swiftinterface -o %t/Macros.swiftmodule
@@ -49,5 +49,12 @@
// CHECK-NEXT: #endif
@attached(accessor, names: named(init)) public macro AccessorInitFunc() = #externalMacro(module: "SomeModule", type: "AccessorInitFuncMacro")
// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros
// CHECK: @attached(extension) @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
// CHECK-NEXT: #else
// CHECK: @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
// CHECK-NEXT: #endif
@attached(extension) @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
// CHECK-NOT: internalStringify
@freestanding(expression) macro internalStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")