@@ -32,31 +32,47 @@ macro Invalid() = #externalMacro(module: "MacroDefinition", type: "InvalidMacro"
32
32
33
33
@Invalid
34
34
struct Bad { }
35
- // expected-note@-1 7 {{in expansion of macro 'Invalid' here}}
35
+ // expected-note@-1 18 {{in expansion of macro 'Invalid' here}}
36
36
37
37
// CHECK-DIAGS: error: macro expansion cannot introduce import
38
- // CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
39
- // CHECK-DIAGS: import Swift
40
-
41
38
// CHECK-DIAGS: error: macro expansion cannot introduce precedence group
42
- // CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
43
- // CHECK-DIAGS: precedencegroup MyPrecedence {}
44
-
45
39
// CHECK-DIAGS: error: macro expansion cannot introduce macro
46
- // CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
47
- // CHECK-DIAGS: @attached(member) macro myMacro()
48
-
49
40
// CHECK-DIAGS: error: macro expansion cannot introduce extension
50
- // CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
51
- // CHECK-DIAGS: extension Int {}
41
+ // CHECK-DIAGS: error: macro expansion cannot introduce '@main' type
42
+ // CHECK-DIAGS: error: declaration name 'MyMain' is not covered by macro 'Invalid'
43
+ // CHECK-DIAGS: error: declaration name 'Array' is not covered by macro 'Invalid'
44
+ // CHECK-DIAGS: error: declaration name 'Dictionary' is not covered by macro 'Invalid'
45
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'BooleanLiteralType'
46
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'ExtendedGraphemeClusterType'
47
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'FloatLiteralType'
48
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'IntegerLiteralType'
49
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'StringLiteralType'
50
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type 'UnicodeScalarType'
51
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type '_ColorLiteralType'
52
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type '_ImageLiteralType'
53
+ // CHECK-DIAGS: error: macro expansion cannot introduce default literal type '_FileReferenceLiteralType'
52
54
53
- // CHECK-DIAGS: error: macro expansion cannot introduce '@main' type'
54
55
// CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
56
+ // CHECK-DIAGS: import Swift
57
+ // CHECK-DIAGS: precedencegroup MyPrecedence {}
58
+ // CHECK-DIAGS: @attached(member) macro myMacro()
59
+ // CHECK-DIAGS: extension Int {}
55
60
// CHECK-DIAGS: @main
56
-
57
- // CHECK-DIAGS: error: declaration name 'MyMain' is not covered by macro 'Invalid'
58
- // CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser3BadV7InvalidfMp_.swift
59
61
// CHECK-DIAGS: struct MyMain {
62
+ // CHECK-DIAGS: static func main() {}
63
+ // CHECK-DIAGS: }
64
+ // CHECK-DIAGS: typealias Array = Void
65
+ // CHECK-DIAGS: typealias Dictionary = Void
66
+ // CHECK-DIAGS: typealias BooleanLiteralType = Void
67
+ // CHECK-DIAGS: typealias ExtendedGraphemeClusterType = Void
68
+ // CHECK-DIAGS: typealias FloatLiteralType = Void
69
+ // CHECK-DIAGS: typealias IntegerLiteralType = Void
70
+ // CHECK-DIAGS: typealias StringLiteralType = Void
71
+ // CHECK-DIAGS: typealias UnicodeScalarType = Void
72
+ // CHECK-DIAGS: typealias _ColorLiteralType = Void
73
+ // CHECK-DIAGS: typealias _ImageLiteralType = Void
74
+ // CHECK-DIAGS: typealias _FileReferenceLiteralType = Void
75
+ // CHECK-DIAGS: END CONTENTS OF FILE
60
76
#endif
61
77
62
78
@freestanding ( expression) macro customFileID( ) -> String = #externalMacro( module: " MacroDefinition " , type: " FileIDMacro " )
0 commit comments