@@ -16,36 +16,58 @@ let magnitude: Never = fatalError()
16
16
// Test resolution of main:: using `B`
17
17
18
18
extension main : : B { }
19
- // FIXME improve: expected-error@-1 {{use of undeclared type 'main::B'}}
19
+ // expected-error@-1 {{type 'B' is not imported through module 'main'}}
20
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-15=ModuleSelectorTestingKit}}
20
21
21
22
extension B : main : : Equatable {
23
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'main'}}
24
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-18=Swift}}
25
+
22
26
@_implements ( main: : Equatable, main: : == ( _: _: ) )
23
27
// expected-error@-1 {{name cannot be qualified with module selector here}} {{33-39=}}
24
- public static func equals( _: main : : B, _: main : : B) -> main : : Bool { main: : fatalError( ) }
25
-
28
+ // expected-error@-2 {{type 'Equatable' is not imported through module 'main'}}
29
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{16-20=Swift}}
30
+ public static func equals( _: main : : B, _: main : : B) -> main : : Bool {
31
+ // expected-error@-1 2{{type 'B' is not imported through module 'main'}}
32
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-36=ModuleSelectorTestingKit}}
33
+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{44-48=ModuleSelectorTestingKit}}
34
+ // expected-error@-4 {{type 'Bool' is not imported through module 'main'}}
35
+ // expected-note@-5 {{did you mean module 'Swift'?}} {{56-60=Swift}}
36
+ main: : fatalError( )
37
+ // expected-EVENTUALLY-error@-1 {{type 'fatalError' is not imported through module 'main'}}
38
+ // expected-EVENTUALLY-note@-2 {{did you mean module 'Swift'?}} {{4-8=Swift}}
39
+ }
40
+
26
41
// FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
27
42
// @_derivative(of:)
28
43
29
44
@_dynamicReplacement ( for: main: : negate( ) )
30
45
// FIXME improve: expected-error@-1 {{replaced function 'main::negate()' could not be found}}
31
46
mutating func myNegate( ) {
32
47
let fn : ( main: : Int , main : : Int ) -> main : : Int =
33
- // FIXME:
48
+ // expected-error@-1 3{{type 'Int' is not imported through module 'main'}}
49
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-18=Swift}}
50
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{25-29=Swift}}
51
+ // expected-note@-4 {{did you mean module 'Swift'?}} {{39-43=Swift}}
34
52
( main: : + )
35
- // expected-error@-1 {{cannot convert value of type '()' to specified type '(Int, Int) -> Int'}}
53
+ // FIXME: it'd be nice to handle module selectors on operators.
36
54
// expected-error@-2 {{expected expression}}
37
55
// expected-error@-3 {{expected expression after operator}}
38
56
39
57
let magnitude : Int . main : : Magnitude = main: : magnitude
40
- // expected-EVENTUALLY-error@-1 {{can't find 'Int'}}
41
- // FIXME improve: expected-error@-2 {{type alias 'Magnitude' is not a member type of 'Int'}}
42
- // FIXME: expected-error@-3 {{variable used within its own initial value}}
58
+ // expected-error@-1 {{type 'Magnitude' is not imported through module 'main'}}
59
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-28=Swift}}
60
+ // FIXME incorrect: expected-error@-3 {{variable used within its own initial value}}
61
+
43
62
if main: : Bool. main : : rando m( ) {
63
+ // FIXME improve: expected-error@-1 {{use of unresolved identifier 'main::Bool'}}
64
+
44
65
main: : negate( )
45
- // FIXME improve: expected-error@-1 {{use of unresolved identifier 'main::negate'}}
66
+ // FIXME improve, suggest adding 'self.' : expected-error@-1 {{use of unresolved identifier 'main::negate'}}
46
67
}
47
68
else {
48
69
self = main : : B( value: . main: : min)
70
+ // FIXME improve: expected-error@-1 {{use of unresolved identifier 'main::B'}}
49
71
}
50
72
51
73
self . main : : myNegate( )
@@ -59,30 +81,45 @@ extension B: main::Equatable {
59
81
extension C { }
60
82
61
83
extension ModuleSelectorTestingKit : : C : ModuleSelectorTestingKit : : Equatable {
62
- // FIXME improve: expected-error@-1 {{use of undeclared type 'ModuleSelectorTestingKit::Equatable'}}
84
+ // expected-error@-1 {{type 'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
85
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{39-62=Swift}}
86
+
63
87
@_implements ( ModuleSelectorTestingKit: : Equatable, ModuleSelectorTestingKit: : == ( _: _: ) )
64
- // FIXME improve: expected-error@-1 {{use of undeclared type 'ModuleSelectorTestingKit::Equatable'}}
65
- // expected-error@-2 {{name cannot be qualified with module selector here}} {{52-77=}}
66
- public static func equals( _: ModuleSelectorTestingKit : : C, _: ModuleSelectorTestingKit : : C) -> ModuleSelectorTestingKit : : Bool { ModuleSelectorTestingKit: : fatalError( ) }
67
- // FIXME improve: expected-error@-1 {{use of undeclared type 'ModuleSelectorTestingKit::Bool'}}
88
+ // expected-error@-1 {{name cannot be qualified with module selector here}} {{52-77=}}
89
+ // expected-error@-2 {{type 'Equatable' is not imported through module 'ModuleSelectorTestingKit'}}
90
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{16-39=Swift}}
91
+
92
+ public static func equals( _: ModuleSelectorTestingKit : : C, _: ModuleSelectorTestingKit : : C) -> ModuleSelectorTestingKit : : Bool {
93
+ // expected-error@-1 {{type 'Bool' is not imported through module 'ModuleSelectorTestingKit'}}
94
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{94-117=Swift}}
95
+ ModuleSelectorTestingKit: : fatalError( )
96
+ // expected-EVENTUALLY-error@-1 {{type 'fatalError' is not imported through module 'main'}}
97
+ // expected-EVENTUALLY-note@-2 {{did you mean module 'Swift'?}} {{4-8=Swift}}
98
+ }
68
99
69
100
// FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
70
101
// @_derivative(of:)
71
102
72
103
@_dynamicReplacement ( for: ModuleSelectorTestingKit: : negate( ) )
73
104
mutating func myNegate( ) {
74
105
let fn : ( ModuleSelectorTestingKit: : Int , ModuleSelectorTestingKit : : Int ) -> ModuleSelectorTestingKit : : Int =
75
- // FIXME improve: expected-error@-1 3{{use of undeclared type 'ModuleSelectorTestingKit::Int'}}
76
- // FIXME:
106
+ // expected-error@-1 3{{type 'Int' is not imported through module 'ModuleSelectorTestingKit'}}
107
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{14-37=Swift}}
108
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{44-67=Swift}}
109
+ // expected-note@-4 {{did you mean module 'Swift'?}} {{77-100=Swift}}
77
110
( ModuleSelectorTestingKit: : + )
78
- // expected-error@-1 {{expected expression}}
79
- // expected-error@-2 {{expected expression after operator}}
111
+ // FIXME: it'd be nice to handle module selectors on operators.
112
+ // expected-error@-2 {{expected expression}}
113
+ // expected-error@-3 {{expected expression after operator}}
114
+
80
115
let magnitude : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
81
- // expected-EVENTUALLY-error@-1 {{something about not finding 'magnitude' because we didn't look in self}}
82
- // FIXME improve: expected-error@-2 {{type alias 'Magnitude' is not a member type of 'Int'}}
83
- // FIXME: expected-error@-3 {{variable used within its own initial value}}
116
+ // expected-error@-1 {{type 'Magnitude' is not imported through module 'ModuleSelectorTestingKit'}}
117
+ // expected-note@-2 {{did you mean module 'Swift'?}} {{24-47=Swift}}
118
+ // FIXME incorrect: expected-error@-3 {{variable used within its own initial value}}
119
+
84
120
if ModuleSelectorTestingKit : : Bool. ModuleSelectorTestingKit : : rando m( ) {
85
121
// FIXME improve: expected-error@-1 {{use of unresolved identifier 'ModuleSelectorTestingKit::Bool'}}
122
+
86
123
ModuleSelectorTestingKit: : negate( )
87
124
// FIXME improve, suggest adding 'self.': expected-error@-1 {{use of unresolved identifier 'ModuleSelectorTestingKit::negate'}}
88
125
}
@@ -101,13 +138,22 @@ extension ModuleSelectorTestingKit::C: ModuleSelectorTestingKit::Equatable {
101
138
// FIXME: Many more of these should fail once the feature is actually implemented.
102
139
103
140
extension Swift : : D { }
104
- // FIXME improve: expected-error@-1 {{use of undeclared type 'Swift::D'}}
141
+ // expected-error@-1 {{type 'D' is not imported through module 'Swift'}}
142
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{11-16=ModuleSelectorTestingKit}}
105
143
106
144
extension D : Swift : : Equatable {
145
+ // FIXME wat: expected-error@-1 2{{implementation of 'Equatable' cannot be automatically synthesized in an extension in a different file to the type}}
146
+
107
147
@_implements ( Swift: : Equatable, Swift: : == ( _: _: ) )
108
148
// expected-error@-1 {{name cannot be qualified with module selector here}} {{34-41=}}
109
- public static func equals( _: Swift : : D, _: Swift : : D) -> Swift : : Bool { Swift: : fatalError( ) }
110
-
149
+
150
+ public static func equals( _: Swift : : D, _: Swift : : D) -> Swift : : Bool {
151
+ // expected-error@-1 2{{type 'D' is not imported through module 'Swift'}}
152
+ // expected-note@-2 {{did you mean module 'ModuleSelectorTestingKit'?}} {{32-37=ModuleSelectorTestingKit}}
153
+ // expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{45-50=ModuleSelectorTestingKit}}
154
+ Swift: : fatalError( )
155
+ }
156
+
111
157
// FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
112
158
// @_derivative(of:)
113
159
@@ -129,6 +175,7 @@ extension D: Swift::Equatable {
129
175
}
130
176
else {
131
177
self = Swift : : D( value: . ModuleSelectorTestingKit: : min)
178
+ // FIXME improve: expected-error@-1 {{use of unresolved identifier 'Swift::D'}}
132
179
}
133
180
134
181
self . Swift : : myNegate( )
@@ -203,13 +250,16 @@ func main::decl1(
203
250
// expected-error@-1 {{name of function declaration cannot be qualified with module selector}}
204
251
main: : p1: main: : A,
205
252
// expected-error@-1 {{argument label cannot be qualified with module selector}}
206
- // FIXME access path: expected-error@-2 {{use of undeclared type 'main::A'}}
253
+ // FIXME access path: expected-error@-2 {{type 'A' is not imported through module 'main'}}
254
+ // FIXME access path: expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{13-17=ModuleSelectorTestingKit}}
207
255
main: : label p2 : main: : A,
208
256
// expected-error@-1 {{argument label cannot be qualified with module selector}}
209
- // FIXME access path: expected-error@-2 {{use of undeclared type 'main::A'}}
257
+ // FIXME access path: expected-error@-2 {{type 'A' is not imported through module 'main'}}
258
+ // FIXME access path: expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{19-23=ModuleSelectorTestingKit}}
210
259
label main: : p3: main: : A
211
260
// expected-error@-1 {{name of parameter declaration cannot be qualified with module selector}}
212
- // FIXME access path: expected-error@-2 {{use of undeclared type 'main::A'}}
261
+ // FIXME access path: expected-error@-2 {{type 'A' is not imported through module 'main'}}
262
+ // FIXME access path: expected-note@-3 {{did you mean module 'ModuleSelectorTestingKit'?}} {{19-23=ModuleSelectorTestingKit}}
213
263
) {
214
264
let main : : decl1a = " a "
215
265
// expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
@@ -293,7 +343,8 @@ class main::decl4<main::T> {}
293
343
294
344
typealias main : : decl5 = main : : Bool
295
345
// expected-error@-1 {{name of typealias declaration cannot be qualified with module selector}}
296
- // FIXME improve: expected-error@-2 {{use of undeclared type 'main::Bool'}}
346
+ // expected-error@-2 {{type 'Bool' is not imported through module 'main'}}
347
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{25-29=Swift}}
297
348
298
349
protocol main: : decl6 {
299
350
// expected-error@-1 {{name of protocol declaration cannot be qualified with module selector}}
@@ -334,7 +385,8 @@ struct Parent {
334
385
335
386
typealias main : : decl5 = main : : Bool
336
387
// expected-error@-1 {{name of typealias declaration cannot be qualified with module selector}}
337
- // FIXME improve: expected-error@-2 {{use of undeclared type 'main::Bool'}}
388
+ // expected-error@-2 {{type 'Bool' is not imported through module 'main'}}
389
+ // expected-note@-3 {{did you mean module 'Swift'?}} {{27-31=Swift}}
338
390
}
339
391
340
392
@_swift_native_objc_runtime_base ( main: : BaseClass)
0 commit comments