Skip to content

Commit e25f542

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 bfb5c8a commit e25f542

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/NameLookup/module_selector.swift

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

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

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

105103
if main::Bool.main::random() {
106104
// 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'}}
@@ -193,7 +190,7 @@ extension Swift::D {}
193190
// expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-16=ModuleSelectorTestingKit}}
194191

195192
extension D: Swift::Equatable {
196-
// FIXME wat: expected-error@-1 *{{implementation of 'Equatable' cannot be automatically synthesized in an extension in a different file to the type}}
193+
// FIXME wat: expected-error@-1 *{{extension outside of file declaring struct 'D' prevents automatic synthesis of '==' for protocol 'Equatable'}}
197194

198195
@_implements(Swift::Equatable, Swift::==(_:_:))
199196
// expected-error@-1 {{name cannot be qualified with module selector here}} {{34-41=}}
@@ -220,8 +217,8 @@ extension D: 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'}}
@@ -468,7 +465,7 @@ func badModuleNames() {
468465
// FIXME improve: expected-error@-1 {{value of type 'String' has no member 'NonexistentModule::count'}}
469466

470467
let x: NonexistentModule::MyType = NonexistentModule::MyType()
471-
// expected-error@-1 {{use of undeclared type 'NonexistentModule::MyType'}}
468+
// expected-error@-1 {{cannot find type 'NonexistentModule::MyType' in scope}}
472469

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

0 commit comments

Comments
 (0)