[Macros] Serialization and printing for @attached.

This commit is contained in:
Doug Gregor
2023-01-14 21:46:22 -08:00
parent de16b47875
commit 43cadcad3a
8 changed files with 120 additions and 17 deletions

View File

@@ -16,5 +16,10 @@
// CHECK-NEXT: #endif
@expression public macro publicLine<T: ExpressibleByIntegerLiteral>: T = #externalMacro(module: "SomeModule", type: "Line")
// CHECK: #if compiler(>=5.3) && $Macros
// CHECK: @attached(accessor) public macro myWrapper: Swift.Void = #externalMacro(module: "SomeModule", type: "Wrapper")
// CHECK-NEXT: #endif
@attached(accessor) public macro myWrapper: Void = #externalMacro(module: "SomeModule", type: "Wrapper")
// CHECK-NOT: internalStringify
@expression macro internalStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")