Start requiring expression macros to be marked with @expression

This commit is contained in:
Doug Gregor
2022-12-21 15:54:50 -08:00
parent 3e2bafc2f2
commit f78f5729c3
11 changed files with 48 additions and 35 deletions

View File

@@ -7,14 +7,14 @@
// RUN: %target-swift-frontend -compile-module-from-interface %t/Macros.swiftinterface -o %t/Macros.swiftmodule
// CHECK: #if compiler(>=5.3) && $Macros
// CHECK-NEXT: public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = SomeModule.StringifyMacro
// CHECK-NEXT: @expression public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = SomeModule.StringifyMacro
// CHECK-NEXT: #endif
public macro publicStringify<T>(_ value: T) -> (T, String) = SomeModule.StringifyMacro
@expression public macro publicStringify<T>(_ value: T) -> (T, String) = SomeModule.StringifyMacro
// CHECK: #if compiler(>=5.3) && $Macros
// CHECK: public macro publicLine<T>: T = SomeModule.Line where T : Swift.ExpressibleByIntegerLiteral
// CHECK: @expression public macro publicLine<T>: T = SomeModule.Line where T : Swift.ExpressibleByIntegerLiteral
// CHECK-NEXT: #endif
public macro publicLine<T: ExpressibleByIntegerLiteral>: T = SomeModule.Line
@expression public macro publicLine<T: ExpressibleByIntegerLiteral>: T = SomeModule.Line
// CHECK-NOT: internalStringify
macro internalStringify<T>(_ value: T) -> (T, String) = SomeModule.StringifyMacro
@expression macro internalStringify<T>(_ value: T) -> (T, String) = SomeModule.StringifyMacro