mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Adopt @freestanding(expression) for all @expression macros
This commit is contained in:
@@ -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: @expression public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
// CHECK-NEXT: @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
// CHECK-NEXT: #endif
|
||||
@expression public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
@freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $Macros
|
||||
// CHECK: @expression public macro publicLine<T>: T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
|
||||
// CHECK: @freestanding(expression) public macro publicLine<T>: T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
|
||||
// CHECK-NEXT: #endif
|
||||
@expression public macro publicLine<T: ExpressibleByIntegerLiteral>: T = #externalMacro(module: "SomeModule", type: "Line")
|
||||
@freestanding(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")
|
||||
@@ -22,4 +22,4 @@
|
||||
@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")
|
||||
@freestanding(expression) macro internalStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
|
||||
|
||||
Reference in New Issue
Block a user