Skip to content

Commit 5802d21

Browse files
committed
Update tests to match modern diagnostics
After nearly a year, the compiler has fixed a couple of bugs and changed a couple more diagnostics.
1 parent d7d7386 commit 5802d21

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/NameLookup/module_selector.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ extension ModuleSelectorTestingKit::A: @retroactive Swift::Equatable {
3939
// FIXME: it'd be nice to handle module selectors on operators.
4040

4141
let magnitude: Int.Swift::Magnitude = main::magnitude
42-
// FIXME incorrect: expected-error@-1 {{variable used within its own initial value}}
43-
// expected-EVENTUALLY-error@-1 {{something about type mismatch between 'Never' and 'Int.Swift::Magnitude'}}
42+
// expected-error@-1 {{cannot convert value of type 'Never' to specified type 'Int.Magnitude' (aka 'UInt')}}
4443

4544
if Swift::Bool.Swift::random() {
4645
self.ModuleSelectorTestingKit::negate()
@@ -99,7 +98,6 @@ extension B: main::Equatable {
9998
let magnitude: Int.main::Magnitude = main::magnitude
10099
// expected-error@-1 {{type 'Magnitude' is not imported through module 'main'}}
101100
// expected-note@-2 {{did you mean module 'Swift'?}} {{24-28=Swift}}
102-
// FIXME incorrect: expected-error@-3 {{variable used within its own initial value}}
103101

104102
if main::Bool.main::random() {
105103
// expected-error@-1 {{declaration 'Bool' is not imported through module 'main'}}
@@ -163,7 +161,6 @@ extension ModuleSelectorTestingKit::C: ModuleSelectorTestingKit::Equatable {
163161
let magnitude: Int.ModuleSelectorTestingKit::Magnitude = ModuleSelectorTestingKit::magnitude
164162
// expected-error@-1 {{type 'Magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
165163
// expected-note@-2 {{did you mean module 'Swift'?}} {{24-48=Swift}}
166-
// FIXME incorrect: expected-error@-3 {{variable used within its own initial value}}
167164

168165
if ModuleSelectorTestingKit::Bool.ModuleSelectorTestingKit::random() {
169166
// expected-error@-1 {{declaration 'Bool' is not imported through module 'ModuleSelectorTestingKit'}}
@@ -220,8 +217,8 @@ extension D: @retroactive Swift::Equatable {
220217
// expected-error@-2 {{expected expression}}
221218
// expected-error@-3 {{expected expression after operator}}
222219
let magnitude: Int.Swift::Magnitude = Swift::magnitude
223-
// expected-EVENTUALLY-error@-1 {{something about not finding 'magnitude' because we didn't look in self}}
224-
// FIXME: expected-error@-2 {{variable used within its own initial value}}
220+
// expected-error@-1 {{declaration 'magnitude' is not imported through module 'Swift'}}
221+
// FIXME should be un-addressable via main: expected-note@-2 {{did you mean module 'main'?}}
225222
if Swift::Bool.Swift::random() {
226223
Swift::negate()
227224
// expected-error@-1 {{declaration 'negate' is not imported through module 'Swift'}}
@@ -469,7 +466,7 @@ func badModuleNames() {
469466
// FIXME improve: expected-error@-1 {{value of type 'String' has no member 'NonexistentModule::count'}}
470467

471468
let x: NonexistentModule::MyType = NonexistentModule::MyType()
472-
// expected-error@-1 {{use of undeclared type 'NonexistentModule::MyType'}}
469+
// expected-error@-1 {{cannot find type 'NonexistentModule::MyType' in scope}}
473470

474471
let y: A.NonexistentModule::MyChildType = fatalError()
475472
// expected-error@-1 {{'NonexistentModule::MyChildType' is not a member type of 'A'}}

0 commit comments

Comments
 (0)