@@ -64,18 +64,23 @@ extension A: @retroactive Swift::Equatable {
64
64
// Test resolution of main:: using `B`
65
65
66
66
extension main : : B { }
67
- // FIXME improve: expected-error@-1 {{cannot find type 'main::B' in scope}}
67
+ // expected-error@-1 {{type 'B' is not imported through module 'main'}}
68
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-15=ModuleSelectorTestingKit}}
68
69
69
70
extension B : @retroactive main : : Equatable {
70
- // FIXME improve: expected-error@-1 {{cannot find type 'main::Equatable' in scope}}
71
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'main'}}
72
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{27-31=Swift}}
71
73
72
74
@_implements ( main: : Equatable, == ( _: _: ) )
73
- // FIXME improve: expected-error@-1 {{cannot find type 'main::Equatable' in scope}}
75
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'main'}}
76
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{16-20=Swift}}
74
77
75
78
public static func equals( _: main : : B, _: main : : B) -> main : : Bool {
76
- // FIXME improve: expected-error@-1 {{cannot find type 'main::B' in scope}}
77
- // FIXME improve: expected-error@-2 {{cannot find type 'main::B' in scope}}
78
- // FIXME improve: expected-error@-3 {{cannot find type 'main::Bool' in scope}}
79
+ // expected-error@-1 2{{type 'B' is not imported through module 'main'}}
80
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-36=ModuleSelectorTestingKit}}
81
+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{44-48=ModuleSelectorTestingKit}}
82
+ // expected-error@-4 {{type 'Bool' is not imported through module 'main'}}
83
+ // expected-note@-5 {{did you mean module 'Swift'?}} {{56-60=Swift}}
79
84
main: : fatalError( ) // no-error -- not typechecking function bodies
80
85
}
81
86
@@ -87,12 +92,16 @@ extension B: @retroactive main::Equatable {
87
92
88
93
mutating func myNegate( ) {
89
94
let fn : ( main: : Int , main : : Int ) -> main : : Int =
90
- // FIXME improve: expected-error@-1 3{{cannot find type 'main::Int' in scope}}
95
+ // expected-error@-1 3{{type 'Int' is not imported through module 'main'}}
96
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-18=Swift}}
97
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{25-29=Swift}}
98
+ // expected-note@-4 {{did you mean module 'Swift'?}} {{39-43=Swift}}
91
99
( main: : + )
92
100
// FIXME: should fail????
93
101
94
102
let magnitude : Int . main : : Magnitude = main: : magnitude
95
- // FIXME improve: expected-error@-1 {{'main::Magnitude' is not a member type of struct 'Swift.Int'}}
103
+ // expected-error@-1 {{type 'Magnitude' is not imported through module 'main'}}
104
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-28=Swift}}
96
105
97
106
_ = ( fn, magnitude)
98
107
@@ -126,13 +135,16 @@ extension B: @retroactive main::Equatable {
126
135
extension ModuleSelectorTestingKit : : C { }
127
136
128
137
extension C : @retroactive ModuleSelectorTestingKit : : Equatable {
129
- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Equatable' in scope}}
138
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
139
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{27-51=Swift}}
130
140
131
141
@_implements ( ModuleSelectorTestingKit: : Equatable, == ( _: _: ) )
132
- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Equatable' in scope}}
142
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
143
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{16-40=Swift}}
133
144
134
145
public static func equals( _: ModuleSelectorTestingKit : : C, _: ModuleSelectorTestingKit : : C) -> ModuleSelectorTestingKit : : Bool {
135
- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Bool' in scope}}
146
+ // expected-error@-1 {{type 'Bool' is not imported through module 'ModuleSelectorTestingKit'}}
147
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{96-120=Swift}}
136
148
137
149
ModuleSelectorTestingKit: : fatalError( ) // no-error -- not typechecking function bodies
138
150
}
@@ -146,12 +158,16 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
146
158
// FIXME improve: expected-note@-1 {{did you mean 'myNegate'?}}
147
159
148
160
let fn : ( ModuleSelectorTestingKit: : Int , ModuleSelectorTestingKit : : Int ) -> ModuleSelectorTestingKit : : Int =
149
- // FIXME improve: expected-error@-1 3{{cannot find type 'ModuleSelectorTestingKit::Int' in scope}}
161
+ // expected-error@-1 3{{type 'Int' is not imported through module 'ModuleSelectorTestingKit'}}
162
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-38=Swift}}
163
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{45-69=Swift}}
164
+ // expected-note@-4 {{did you mean module 'Swift'?}} {{79-103=Swift}}
150
165
( ModuleSelectorTestingKit: : + )
151
166
// FIXME: should fail????
152
167
153
168
let magnitude : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
154
- // FIXME improve: expected-error@-1 {{'ModuleSelectorTestingKit::Magnitude' is not a member type of struct 'Swift.Int'}}
169
+ // expected-error@-1 {{type 'Magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
170
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-48=Swift}}
155
171
156
172
_ = ( fn, magnitude)
157
173
@@ -181,15 +197,17 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
181
197
// Test resolution of Swift:: using `D`
182
198
183
199
extension Swift : : D { }
184
- // FIXME improve: expected-error@-1 {{cannot find type 'Swift::D' in scope}}
200
+ // expected-error@-1 {{type 'D' is not imported through module 'Swift'}}
201
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-16=ModuleSelectorTestingKit}}
185
202
186
203
extension D : @retroactive Swift : : Equatable {
187
204
// Caused by Swift::D failing to typecheck in `equals(_:_:)`: expected-error@-1 *{{extension outside of file declaring struct 'D' prevents automatic synthesis of '==' for protocol 'Equatable'}} expected-note@-1 *{{add stubs for conformance}}
188
205
189
206
@_implements ( Swift: : Equatable, == ( _: _: ) )
190
207
public static func equals( _: Swift : : D, _: Swift : : D) -> Swift : : Bool {
191
- // expected-error@-1 {{cannot find type 'Swift::D' in scope}}
192
- // expected-error@-2 {{cannot find type 'Swift::D' in scope}}
208
+ // expected-error@-1 2{{type 'D' is not imported through module 'Swift'}}
209
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-37=ModuleSelectorTestingKit}}
210
+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{45-50=ModuleSelectorTestingKit}}
193
211
Swift: : fatalError( ) // no-error -- not typechecking function bodies
194
212
}
195
213
@@ -270,7 +288,8 @@ func builderUser4(@Swift::MyBuilder fn: () -> Void) {}
270
288
271
289
func decl1(
272
290
p1: main: : A,
273
- // FIXME: expected-error@-1 {{cannot find type 'main::A' in scope}}
291
+ // expected-error@-1 {{type 'A' is not imported through module 'main'}}
292
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{7-11=ModuleSelectorTestingKit}}
274
293
label p2 : inout A,
275
294
label p3 : @escaping ( ) - > A
276
295
) {
@@ -300,7 +319,8 @@ func decl1(
300
319
}
301
320
302
321
typealias decl5 = main: : Bool
303
- // FIXME improve: expected-error@-1 {{cannot find type 'main::Bool' in scope}}
322
+ // expected-error@-1 {{type 'Bool' is not imported through module 'main'}}
323
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{19-23=Swift}}
304
324
305
325
func badModuleNames( ) {
306
326
NonexistentModule: : print( )
0 commit comments