|
4 | 4 | // expected-note@-1 2{{'stringify' declared here}}
|
5 | 5 | @expression macro missingMacro1(_: Any) = MissingModule.MissingType // expected-note{{'missingMacro1' declared here}}
|
6 | 6 | // expected-warning@-1{{external macro definitions are now written using #externalMacro}}{{43-68=#externalMacro(module: "MissingModule", type: "MissingType")}}
|
7 |
| -@expression macro missingMacro2(_: Any) = MissingModule.MissingType |
| 7 | +@expression macro missingMacro2(_: Any) = #externalMacro(module: "MissingModule", type: "MissingType") |
8 | 8 |
|
9 | 9 | protocol P { }
|
10 | 10 |
|
11 |
| -@expression macro tryToHide<T: P>(_: P) -> some P = BuiltinMacros.Blah |
| 11 | +@expression macro tryToHide<T: P>(_: T) -> some P = #externalMacro(module: "BuiltinMacros", type: "Blah") |
12 | 12 | // expected-error@-1{{some' types are only permitted in properties, subscripts, and functions}}
|
| 13 | +// expected-error@-2{{generic parameter 'T' could not be inferred}} |
13 | 14 |
|
14 | 15 | internal struct X { } // expected-note{{type declared here}}
|
15 | 16 |
|
16 |
| -@expression public macro createAnX: X = BuiltinMacros.Blah |
| 17 | +@expression public macro createAnX: X = #externalMacro(module: "BuiltinMacros", type: "Blah") |
17 | 18 | // expected-error@-1{{macro cannot be declared public because its result type uses an internal type}}
|
18 | 19 |
|
19 |
| -@expression macro m1: Int = A.B |
20 |
| -@expression macro m1: Float = A.B |
| 20 | +@expression macro m1: Int = #externalMacro(module: "BuiltinMacros", type: "Blah") |
| 21 | +@expression macro m1: Float = #externalMacro(module: "BuiltinMacros", type: "Blah") |
21 | 22 |
|
22 |
| -@expression macro m2: Int = A.B // expected-note{{'m2' previously declared here}} |
23 |
| -@expression macro m2: Int = A.B // expected-error{{invalid redeclaration of 'm2'}} |
| 23 | +@expression macro m2: Int = #externalMacro(module: "BuiltinMacros", type: "Blah") // expected-note{{'m2' previously declared here}} |
| 24 | +@expression macro m2: Int = #externalMacro(module: "BuiltinMacros", type: "Blah") // expected-error{{invalid redeclaration of 'm2'}} |
24 | 25 |
|
25 |
| -@expression macro m3(_: Int) -> Int = A.B |
26 |
| -@expression macro m3(_: Int) -> Float = A.B |
| 26 | +@expression macro m3(_: Int) -> Int = #externalMacro(module: "BuiltinMacros", type: "Blah") |
| 27 | +@expression macro m3(_: Int) -> Float = #externalMacro(module: "BuiltinMacros", type: "Blah") |
27 | 28 |
|
28 |
| -@expression macro m4(_: Int) -> Int = A.B // expected-note{{'m4' previously declared here}} |
29 |
| -@expression macro m4(_: Int) -> Int = A.B // expected-error{{invalid redeclaration of 'm4'}} |
| 29 | +@expression macro m4(_: Int) -> Int = #externalMacro(module: "BuiltinMacros", type: "Blah") // expected-note{{'m4' previously declared here}} |
| 30 | +@expression macro m4(_: Int) -> Int = #externalMacro(module: "BuiltinMacros", type: "Blah") // expected-error{{invalid redeclaration of 'm4'}} |
30 | 31 |
|
31 | 32 | struct ZZZ {
|
32 |
| - macro m5: Int = A.B |
| 33 | + macro m5: Int = #externalMacro(module: "BuiltinMacros", type: "Blah") |
33 | 34 | // expected-error@-1{{macro 'm5' can only be declared at file scope}}
|
34 | 35 | // expected-error@-2{{macro 'm5' must declare its applicable contexts (e.g., '@expression')}}
|
35 | 36 | }
|
36 | 37 |
|
37 |
| -@expression macro multiArgMacro(_: Any, second: Any) = MissingModule.MissingType |
| 38 | +@expression macro multiArgMacro(_: Any, second: Any) = #externalMacro(module: "MissingModule", type: "MissingType") |
38 | 39 | // expected-note@-1{{'multiArgMacro(_:second:)' declared here}}
|
39 | 40 |
|
40 |
| -@expression macro overloaded1(_ p: P) = MissingModule.MissingType |
| 41 | +@expression macro overloaded1(_ p: P) = #externalMacro(module: "MissingModule", type: "MissingType") |
41 | 42 | func overloaded1(_ p: Any) { }
|
42 | 43 |
|
43 |
| -@expression macro notOverloaded1(_ p: P) = MissingModule.MissingType // expected-note{{'notOverloaded1' previously declared here}} |
44 |
| -@expression macro notOverloaded1(_ p: P) = MissingModule.MissingOtherType // expected-error{{invalid redeclaration of 'notOverloaded1'}} |
| 44 | +@expression macro notOverloaded1(_ p: P) = #externalMacro(module: "MissingModule", type: "MissingType") // expected-note{{'notOverloaded1' previously declared here}} |
| 45 | +@expression macro notOverloaded1(_ p: P) = #externalMacro(module: "MissingModule", type: "MissingOtherType") // expected-error{{invalid redeclaration of 'notOverloaded1'}} |
45 | 46 |
|
46 |
| -@expression macro intIdentity(value: Int, _: Float) -> Int = MissingModule.MissingType |
| 47 | +@expression macro intIdentity(value: Int, _: Float) -> Int = #externalMacro(module: "MissingModule", type: "MissingType") |
47 | 48 | // expected-note@-1{{macro 'intIdentity(value:_:)' declared here}}
|
48 | 49 |
|
49 | 50 | func testDiags(a: Int, b: Int) {
|
|
0 commit comments