@@ -87,7 +87,8 @@ extension B: @retroactive main::Equatable {
8787 // expected-error@-4 {{'Bool' is not imported through module 'main'}}
8888 // expected-note@-5 {{did you mean module 'Swift'?}} {{56-60=Swift}}
8989 main: : fatalError( )
90- // FIXME improve: expected-error@-1 {{cannot find 'main::fatalError' in scope}}
90+ // expected-error@-1 {{'fatalError' is not imported through module 'main'}}
91+ // expected-note@-2 {{did you mean module 'Swift'?}} {{5-9=Swift}}
9192 }
9293
9394 // FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
@@ -103,7 +104,9 @@ extension B: @retroactive main::Equatable {
103104 // expected-note@-3 {{did you mean module 'Swift'?}} {{25-29=Swift}}
104105 // expected-note@-4 {{did you mean module 'Swift'?}} {{39-43=Swift}}
105106 ( main: : + )
106- // FIXME improve: expected-error@-1 {{cannot find operator 'main::+' in scope}}
107+ // expected-error@-1 {{'+' is not imported through module 'main'}}
108+ // expected-note@-2 {{did you mean module 'Swift'?}} {{8-12=Swift}}
109+ // expected-note@-3 {{did you mean module '_Concurrency'?}} {{8-12=_Concurrency}} FIXME: Accept and suggest 'Swift::' instead?
107110
108111 let magnitude : Int . main : : Magnitude = main: : magnitude
109112 // expected-error@-1 {{'Magnitude' is not imported through module 'main'}}
@@ -112,15 +115,18 @@ extension B: @retroactive main::Equatable {
112115 _ = ( fn, magnitude)
113116
114117 if main: : Bool. main : : rando m( ) {
115- // FIXME improve: expected-error@-1 {{cannot find 'main::Bool' in scope}}
118+ // expected-error@-1 {{'Bool' is not imported through module 'main'}}
119+ // expected-note@-2 {{did you mean module 'Swift'?}} {{8-12=Swift}}
116120
117121 main: : negate( )
118- // FIXME improve: expected-error@-1 {{cannot find 'main::negate' in scope}}
122+ // expected-error@-1 {{'negate' is not imported through module 'main'}}
123+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{7-11=self.ModuleSelectorTestingKit}}
119124 }
120125 else {
121126 self = main : : B( value: . main: : min)
122- // FIXME improve: expected-error@-1 {{cannot find 'main::B' in scope}}
123- // expected-error@-2 {{cannot infer contextual base in reference to member 'main::min'}}
127+ // expected-error@-1 {{'B' is not imported through module 'main'}}
128+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{14-18=ModuleSelectorTestingKit}}
129+ // expected-error@-3 {{cannot infer contextual base in reference to member 'main::min'}}
124130
125131 self = B . main : : init( value: . min)
126132 // FIXME improve: expected-error@-1 {{'B' cannot be constructed because it has no accessible initializers}}
@@ -130,13 +136,15 @@ extension B: @retroactive main::Equatable {
130136 self . main : : myNegate( )
131137
132138 main: : fatalError( )
133- // FIXME improve: expected-error@-1 {{cannot find 'main::fatalError' in scope}}
139+ // expected-error@-1 {{'fatalError' is not imported through module 'main'}}
140+ // expected-note@-2 {{did you mean module 'Swift'?}} {{5-9=Swift}}
134141
135142 _ = \main : : A. magnitude
136143 // expected-error@-1 {{'A' is not imported through module 'main'}}
137144 // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{10-14=ModuleSelectorTestingKit}}
138145 _ = \A . main: : magnitude
139- // FIXME improve: expected-error@-1 {{value of type 'A' has no member 'main::magnitude'}}
146+ // expected-error@-1 {{'magnitude' is not imported through module 'main'}}
147+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{none}}
140148
141149 _ = #main: : ExprMacro
142150 // expected-error@-1 {{no macro named 'main::ExprMacro'}}
@@ -165,7 +173,8 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
165173 // expected-note@-2 {{did you mean module 'Swift'?}} {{96-120=Swift}}
166174
167175 ModuleSelectorTestingKit: : fatalError( )
168- // FIXME improve: expected-error@-1 {{cannot find 'ModuleSelectorTestingKit::fatalError' in scope}}
176+ // expected-error@-1 {{'fatalError' is not imported through module 'ModuleSelectorTestingKit'}}
177+ // expected-note@-2 {{did you mean module 'Swift'?}} {{5-29=Swift}}
169178 }
170179
171180 // FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
@@ -174,26 +183,33 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
174183 @_dynamicReplacement ( for: ModuleSelectorTestingKit: : negate( ) )
175184
176185 mutating func myNegate( ) {
186+ // expected-note@-1 {{did you mean 'myNegate'?}}
187+
177188 let fn : ( ModuleSelectorTestingKit: : Int , ModuleSelectorTestingKit : : Int ) -> ModuleSelectorTestingKit : : Int =
178189 // expected-error@-1 3{{'Int' is not imported through module 'ModuleSelectorTestingKit'}}
179190 // expected-note@-2 {{did you mean module 'Swift'?}} {{14-38=Swift}}
180191 // expected-note@-3 {{did you mean module 'Swift'?}} {{45-69=Swift}}
181192 // expected-note@-4 {{did you mean module 'Swift'?}} {{79-103=Swift}}
182193 ( ModuleSelectorTestingKit: : + )
183- // FIXME improve: expected-error@-1 {{cannot find operator 'ModuleSelectorTestingKit::+' in scope}}
194+ // expected-error@-1 {{'+' is not imported through module 'ModuleSelectorTestingKit'}}
195+ // expected-note@-2 {{did you mean module 'Swift'?}} {{8-32=Swift}}
196+ // expected-note@-3 {{did you mean module '_Concurrency'?}} {{8-32=_Concurrency}} FIXME: Accept and suggest 'Swift::' instead?
184197
185198 let magnitude : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
186199 // expected-error@-1 {{'Magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
187200 // expected-note@-2 {{did you mean module 'Swift'?}} {{24-48=Swift}}
188- // FIXME improve: expected-error@-3 {{cannot find 'ModuleSelectorTestingKit::magnitude' in scope}}
201+ // expected-error@-3 {{'magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
202+ // expected-note@-4 {{did you mean the local declaration?}} {{62-88=}}
189203
190204 _ = ( fn, magnitude)
191205
192206 if ModuleSelectorTestingKit : : Bool. ModuleSelectorTestingKit : : rando m( ) {
193- // FIXME improve: expected-error@-1 {{cannot find 'ModuleSelectorTestingKit::Bool' in scope}}
207+ // expected-error@-1 {{'Bool' is not imported through module 'ModuleSelectorTestingKit'}}
208+ // expected-note@-2 {{did you mean module 'Swift'?}} {{8-32=Swift}}
194209
195210 ModuleSelectorTestingKit: : negate( )
196- // expected-error@-1 {{cannot find 'ModuleSelectorTestingKit::negate' in scope}}
211+ // expected-error@-1 {{'negate' is not imported through module 'ModuleSelectorTestingKit'}}
212+ // expected-note@-2 {{did you mean the member of 'self'?}} {{7-7=self.}}
197213 }
198214 else {
199215 self = ModuleSelectorTestingKit : : C( value: . ModuleSelectorTestingKit: : min)
@@ -206,7 +222,8 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
206222 // FIXME improve: expected-error@-1 {{value of type 'C' has no member 'ModuleSelectorTestingKit::myNegate'}}
207223
208224 ModuleSelectorTestingKit: : fatalError( )
209- // FIXME improve: expected-error@-1 {{cannot find 'ModuleSelectorTestingKit::fatalError' in scope}}
225+ // expected-error@-1 {{'fatalError' is not imported through module 'ModuleSelectorTestingKit'}}
226+ // expected-note@-2 {{did you mean module 'Swift'?}} {{5-29=Swift}}
210227
211228 _ = \ModuleSelectorTestingKit : : A. magnitude
212229 _ = \A . ModuleSelectorTestingKit: : magnitude
@@ -244,24 +261,28 @@ extension D: @retroactive Swift::Equatable {
244261 // FIXME improve: expected-error@-1 {{replaced function 'Swift::negate()' could not be found}}
245262
246263 mutating func myNegate( ) {
264+ // expected-note@-1 {{did you mean 'myNegate'?}}
247265
248266 let fn : ( Swift: : Int , Swift : : Int ) -> Swift : : Int =
249267 ( Swift: : + )
250268
251269 let magnitude : Int . Swift : : Magnitude = Swift: : magnitude
252- // expected-error@-1 {{cannot find 'Swift::magnitude' in scope}}
270+ // expected-error@-1 {{'magnitude' is not imported through module 'Swift'}}
271+ // expected-note@-2 {{did you mean the local declaration?}} {{43-50=}}
253272
254273 _ = ( fn, magnitude)
255274
256275 if Swift : : Bool. Swift : : rando m( ) {
257276
258277 Swift: : negate( )
259- // FIXME improve: expected-error@-1 {{cannot find 'Swift::negate' in scope}}
278+ // expected-error@-1 {{'negate' is not imported through module 'Swift'}}
279+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{7-12=self.ModuleSelectorTestingKit}}
260280 }
261281 else {
262282 self = Swift: : D( value: . Swift: : min)
263- // FIXME improve: expected-error@-1 {{cannot find 'Swift::D' in scope}}
264- // expected-error@-2 {{cannot infer contextual base in reference to member 'Swift::min'}}
283+ // expected-error@-1 {{'D' is not imported through module 'Swift'}}
284+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{14-19=ModuleSelectorTestingKit}}
285+ // expected-error@-3 {{cannot infer contextual base in reference to member 'Swift::min'}}
265286
266287 self = D. Swift: : init( value: . min)
267288 // FIXME improve: expected-error@-1 {{'D' cannot be constructed because it has no accessible initializers}}
@@ -277,7 +298,8 @@ extension D: @retroactive Swift::Equatable {
277298 // expected-error@-1 {{'A' is not imported through module 'Swift'}}
278299 // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{10-15=ModuleSelectorTestingKit}}
279300 _ = \A . Swift: : magnitude
280- // FIXME improve: expected-error@-1 {{value of type 'A' has no member 'Swift::magnitude'}}
301+ // expected-error@-1 {{'magnitude' is not imported through module 'Swift'}}
302+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{none}}
281303
282304 _ = #Swift: : ExprMacro
283305 // expected-error@-1 {{no macro named 'Swift::ExprMacro'}}
@@ -293,7 +315,8 @@ let mog: Never = fatalError()
293315
294316func localVarsCantBeAccessedByModuleSelector( ) {
295317 let mag : Int . Swift : : Magnitude = main: : mag
296- // expected-error@-1 {{cannot find 'main::mag' in scope}}
318+ // expected-error@-1 {{'mag' is not imported through module 'main'}}
319+ // expected-note@-2 {{did you mean the local declaration?}} {{35-41=}}
297320
298321 let mog : Never = main: : mog
299322}
@@ -332,23 +355,26 @@ func decl1(
332355 label p3 : @escaping ( ) - > A
333356) {
334357 switch Optional ( main: : p2) {
335- // expected-error@-1 {{cannot find 'main::p2' in scope}}
358+ // expected-error@-1 {{'p2' is not imported through module 'main'}}
359+ // expected-note@-2 {{did you mean the local declaration?}} {{19-25=}}
336360 case Optional . some( let decl1i) :
337361 break
338362 case . none:
339363 break
340364 }
341365
342366 switch Optional ( main: : p2) {
343- // expected-error@-1 {{cannot find 'main::p2' in scope}}
367+ // expected-error@-1 {{'p2' is not imported through module 'main'}}
368+ // expected-note@-2 {{did you mean the local declaration?}} {{19-25=}}
344369 case let Optional . some( decl1j) :
345370 break
346371 case . none:
347372 break
348373 }
349374
350375 switch Optional ( main: : p2) {
351- // expected-error@-1 {{cannot find 'main::p2' in scope}}
376+ // expected-error@-1 {{'p2' is not imported through module 'main'}}
377+ // expected-note@-2 {{did you mean the local declaration?}} {{19-25=}}
352378 case let decl1k? :
353379 break
354380 case . none:
@@ -362,7 +388,8 @@ typealias decl5 = main::Bool
362388
363389func badModuleNames( ) {
364390 NonexistentModule: : print( )
365- // expected-error@-1 {{cannot find 'NonexistentModule::print' in scope}}
391+ // expected-error@-1 {{'print' is not imported through module 'NonexistentModule'}}
392+ // expected-note@-2 {{did you mean module 'Swift'?}} {{3-20=Swift}}
366393
367394 _ = " foo " . NonexistentModule: : count
368395 // FIXME improve: expected-error@-1 {{value of type 'String' has no member 'NonexistentModule::count'}}
0 commit comments