@@ -69,18 +69,23 @@ extension A: @retroactive Swift::Equatable {
6969// Test resolution of main:: using `B`
7070
7171extension main : : B { }
72- // FIXME improve: expected-error@-1 {{cannot find type 'main::B' in scope}}
72+ // expected-error@-1 {{'B' is not imported through module 'main'}}
73+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-15=ModuleSelectorTestingKit}}
7374
7475extension B : @retroactive main : : Equatable {
75- // FIXME improve: expected-error@-1 {{cannot find type 'main::Equatable' in scope}}
76+ // expected-error@-1 {{'Equatable' is not imported through module 'main'}}
77+ // expected-note@-2 {{did you mean module 'Swift'?}} {{27-31=Swift}}
7678
7779 @_implements ( main: : Equatable, == ( _: _: ) )
78- // FIXME improve: expected-error@-1 {{cannot find type 'main::Equatable' in scope}}
80+ // expected-error@-1 {{'Equatable' is not imported through module 'main'}}
81+ // expected-note@-2 {{did you mean module 'Swift'?}} {{16-20=Swift}}
7982
8083 public static func equals( _: main : : B, _: main : : B) -> main : : Bool {
81- // FIXME improve: expected-error@-1 {{cannot find type 'main::B' in scope}}
82- // FIXME improve: expected-error@-2 {{cannot find type 'main::B' in scope}}
83- // FIXME improve: expected-error@-3 {{cannot find type 'main::Bool' in scope}}
84+ // expected-error@-1 2{{'B' is not imported through module 'main'}}
85+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-36=ModuleSelectorTestingKit}}
86+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{44-48=ModuleSelectorTestingKit}}
87+ // expected-error@-4 {{'Bool' is not imported through module 'main'}}
88+ // expected-note@-5 {{did you mean module 'Swift'?}} {{56-60=Swift}}
8489 main: : fatalError( )
8590 // FIXME improve: expected-error@-1 {{cannot find 'main::fatalError' in scope}}
8691 }
@@ -93,12 +98,16 @@ extension B: @retroactive main::Equatable {
9398
9499 mutating func myNegate( ) {
95100 let fn : ( main: : Int , main : : Int ) -> main : : Int =
96- // FIXME improve: expected-error@-1 3{{cannot find type 'main::Int' in scope}}
101+ // expected-error@-1 3{{'Int' is not imported through module 'main'}}
102+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-18=Swift}}
103+ // expected-note@-3 {{did you mean module 'Swift'?}} {{25-29=Swift}}
104+ // expected-note@-4 {{did you mean module 'Swift'?}} {{39-43=Swift}}
97105 ( main: : + )
98106 // FIXME improve: expected-error@-1 {{cannot find operator 'main::+' in scope}}
99107
100108 let magnitude : Int . main : : Magnitude = main: : magnitude
101- // FIXME improve: expected-error@-1 {{'main::Magnitude' is not a member type of struct 'Swift.Int'}}
109+ // expected-error@-1 {{'Magnitude' is not imported through module 'main'}}
110+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-28=Swift}}
102111
103112 _ = ( fn, magnitude)
104113
@@ -124,7 +133,8 @@ extension B: @retroactive main::Equatable {
124133 // FIXME improve: expected-error@-1 {{cannot find 'main::fatalError' in scope}}
125134
126135 _ = \main : : A. magnitude
127- // FIXME improve: expected-error@-1 {{'main::A' in scope}} -- different diagnostic wording for legacy parser vs. ASTGen
136+ // expected-error@-1 {{'A' is not imported through module 'main'}}
137+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{10-14=ModuleSelectorTestingKit}}
128138 _ = \A . main: : magnitude
129139 // FIXME improve: expected-error@-1 {{value of type 'A' has no member 'main::magnitude'}}
130140
@@ -143,13 +153,16 @@ extension B: @retroactive main::Equatable {
143153extension ModuleSelectorTestingKit : : C { }
144154
145155extension C : @retroactive ModuleSelectorTestingKit : : Equatable {
146- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Equatable' in scope}}
156+ // expected-error@-1 {{'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
157+ // expected-note@-2 {{did you mean module 'Swift'?}} {{27-51=Swift}}
147158
148159 @_implements ( ModuleSelectorTestingKit: : Equatable, == ( _: _: ) )
149- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Equatable' in scope}}
160+ // expected-error@-1 {{'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
161+ // expected-note@-2 {{did you mean module 'Swift'?}} {{16-40=Swift}}
150162
151163 public static func equals( _: ModuleSelectorTestingKit : : C, _: ModuleSelectorTestingKit : : C) -> ModuleSelectorTestingKit : : Bool {
152- // FIXME improve: expected-error@-1 {{cannot find type 'ModuleSelectorTestingKit::Bool' in scope}}
164+ // expected-error@-1 {{'Bool' is not imported through module 'ModuleSelectorTestingKit'}}
165+ // expected-note@-2 {{did you mean module 'Swift'?}} {{96-120=Swift}}
153166
154167 ModuleSelectorTestingKit: : fatalError( )
155168 // FIXME improve: expected-error@-1 {{cannot find 'ModuleSelectorTestingKit::fatalError' in scope}}
@@ -162,13 +175,17 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
162175
163176 mutating func myNegate( ) {
164177 let fn : ( ModuleSelectorTestingKit: : Int , ModuleSelectorTestingKit : : Int ) -> ModuleSelectorTestingKit : : Int =
165- // FIXME improve: expected-error@-1 3{{cannot find type 'ModuleSelectorTestingKit::Int' in scope}}
178+ // expected-error@-1 3{{'Int' is not imported through module 'ModuleSelectorTestingKit'}}
179+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-38=Swift}}
180+ // expected-note@-3 {{did you mean module 'Swift'?}} {{45-69=Swift}}
181+ // expected-note@-4 {{did you mean module 'Swift'?}} {{79-103=Swift}}
166182 ( ModuleSelectorTestingKit: : + )
167183 // FIXME improve: expected-error@-1 {{cannot find operator 'ModuleSelectorTestingKit::+' in scope}}
168184
169185 let magnitude : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
170- // FIXME improve: expected-error@-1 {{'ModuleSelectorTestingKit::Magnitude' is not a member type of struct 'Swift.Int'}}
171- // FIXME improve: expected-error@-2 {{cannot find 'ModuleSelectorTestingKit::magnitude' in scope}}
186+ // expected-error@-1 {{'Magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
187+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-48=Swift}}
188+ // FIXME improve: expected-error@-3 {{cannot find 'ModuleSelectorTestingKit::magnitude' in scope}}
172189
173190 _ = ( fn, magnitude)
174191
@@ -206,15 +223,17 @@ extension C: @retroactive ModuleSelectorTestingKit::Equatable {
206223// Test resolution of Swift:: using `D`
207224
208225extension Swift : : D { }
209- // FIXME improve: expected-error@-1 {{cannot find type 'Swift::D' in scope}}
226+ // expected-error@-1 {{'D' is not imported through module 'Swift'}}
227+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-16=ModuleSelectorTestingKit}}
210228
211229extension D : @retroactive Swift : : Equatable {
212230// 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}}
213231
214232 @_implements ( Swift: : Equatable, == ( _: _: ) )
215233 public static func equals( _: Swift : : D, _: Swift : : D) -> Swift : : Bool {
216- // expected-error@-1 {{cannot find type 'Swift::D' in scope}}
217- // expected-error@-2 {{cannot find type 'Swift::D' in scope}}
234+ // expected-error@-1 2{{'D' is not imported through module 'Swift'}}
235+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-37=ModuleSelectorTestingKit}}
236+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{45-50=ModuleSelectorTestingKit}}
218237 Swift: : fatalError( ) // no-error -- not typechecking function bodies
219238 }
220239
@@ -255,7 +274,8 @@ extension D: @retroactive Swift::Equatable {
255274 Swift: : fatalError( )
256275
257276 _ = \Swift : : A. magnitude
258- // FIXME improve: expected-error@-1 {{'Swift::A' in scope}} -- different diagnostic wording for legacy parser vs. ASTGen
277+ // expected-error@-1 {{'A' is not imported through module 'Swift'}}
278+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{10-15=ModuleSelectorTestingKit}}
259279 _ = \A . Swift: : magnitude
260280 // FIXME improve: expected-error@-1 {{value of type 'A' has no member 'Swift::magnitude'}}
261281
@@ -306,7 +326,8 @@ func builderUser4(@Swift::MyBuilder fn: () -> Void) {}
306326
307327func decl1(
308328 p1: main: : A,
309- // FIXME: expected-error@-1 {{cannot find type 'main::A' in scope}}
329+ // expected-error@-1 {{'A' is not imported through module 'main'}}
330+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{7-11=ModuleSelectorTestingKit}}
310331 label p2 : inout A,
311332 label p3 : @escaping ( ) - > A
312333) {
@@ -336,7 +357,8 @@ func decl1(
336357}
337358
338359typealias decl5 = main: : Bool
339- // FIXME improve: expected-error@-1 {{cannot find type 'main::Bool' in scope}}
360+ // expected-error@-1 {{'Bool' is not imported through module 'main'}}
361+ // expected-note@-2 {{did you mean module 'Swift'?}} {{19-23=Swift}}
340362
341363func badModuleNames( ) {
342364 NonexistentModule: : print( )
0 commit comments