@@ -15,7 +15,10 @@ let magnitude: Never = fatalError()
15
15
16
16
// Test resolution of main:: using `B`
17
17
18
- extension main : : B : main : : Equatable {
18
+ extension main : : B { }
19
+ // FIXME improve: expected-error@-1 {{use of undeclared type 'main::B'}}
20
+
21
+ extension B : main : : Equatable {
19
22
@_implements ( main: : Equatable, main: : == ( _: _: ) )
20
23
// expected-error@-1 {{name cannot be qualified with module selector here}} {{33-39=}}
21
24
public static func equals( _: main : : B, _: main : : B) -> main : : Bool { main: : fatalError( ) }
@@ -33,7 +36,7 @@ extension main::B: main::Equatable {
33
36
// expected-error@-2 {{expected expression}}
34
37
// expected-error@-3 {{expected expression after operator}}
35
38
36
- let magnitude : main : : Int . main : : Magnitude = main: : magnitude
39
+ let magnitude : Int . main : : Magnitude = main: : magnitude
37
40
// expected-EVENTUALLY-error@-1 {{can't find 'Int'}}
38
41
// FIXME improve: expected-error@-2 {{type alias 'Magnitude' is not a member type of 'Int'}}
39
42
// FIXME: expected-error@-3 {{variable used within its own initial value}}
@@ -53,27 +56,33 @@ extension main::B: main::Equatable {
53
56
54
57
// Test resolution of ModuleSelectorTestingKit:: using `C`
55
58
59
+ extension C { }
60
+
56
61
extension ModuleSelectorTestingKit : : C : ModuleSelectorTestingKit : : Equatable {
62
+ // FIXME improve: expected-error@-1 {{use of undeclared type 'ModuleSelectorTestingKit::Equatable'}}
57
63
@_implements ( ModuleSelectorTestingKit: : Equatable, ModuleSelectorTestingKit: : == ( _: _: ) )
58
- // expected-error@-1 {{name cannot be qualified with module selector here}} {{52-77=}}
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=}}
59
66
public static func equals( _: ModuleSelectorTestingKit : : C, _: ModuleSelectorTestingKit : : C) -> ModuleSelectorTestingKit : : Bool { ModuleSelectorTestingKit: : fatalError( ) }
60
-
67
+ // FIXME improve: expected-error@-1 {{use of undeclared type 'ModuleSelectorTestingKit::Bool'}}
68
+
61
69
// FIXME: Add tests with autodiff @_differentiable(jvp:vjp:) and
62
70
// @_derivative(of:)
63
71
64
72
@_dynamicReplacement ( for: ModuleSelectorTestingKit: : negate( ) )
65
73
mutating func myNegate( ) {
66
74
let fn : ( ModuleSelectorTestingKit: : Int , ModuleSelectorTestingKit : : Int ) -> ModuleSelectorTestingKit : : Int =
75
+ // FIXME improve: expected-error@-1 3{{use of undeclared type 'ModuleSelectorTestingKit::Int'}}
67
76
// FIXME:
68
77
( ModuleSelectorTestingKit: : + )
69
- // expected-error@-1 {{cannot convert value of type '()' to specified type '(Int, Int) -> Int'}}
70
- // expected-error@-2 {{expected expression}}
71
- // expected-error@-3 {{expected expression after operator}}
72
- let magnitude : ModuleSelectorTestingKit : : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
78
+ // expected-error@-1 {{expected expression}}
79
+ // expected-error@-2 {{expected expression after operator}}
80
+ let magnitude : Int . ModuleSelectorTestingKit : : Magnitude = ModuleSelectorTestingKit: : magnitude
73
81
// expected-EVENTUALLY-error@-1 {{something about not finding 'magnitude' because we didn't look in self}}
74
82
// FIXME improve: expected-error@-2 {{type alias 'Magnitude' is not a member type of 'Int'}}
75
83
// FIXME: expected-error@-3 {{variable used within its own initial value}}
76
84
if ModuleSelectorTestingKit : : Bool. ModuleSelectorTestingKit : : rando m( ) {
85
+ // FIXME improve: expected-error@-1 {{use of unresolved identifier 'ModuleSelectorTestingKit::Bool'}}
77
86
ModuleSelectorTestingKit: : negate( )
78
87
// FIXME improve, suggest adding 'self.': expected-error@-1 {{use of unresolved identifier 'ModuleSelectorTestingKit::negate'}}
79
88
}
@@ -91,7 +100,10 @@ extension ModuleSelectorTestingKit::C: ModuleSelectorTestingKit::Equatable {
91
100
// Test resolution of Swift:: using `D`
92
101
// FIXME: Many more of these should fail once the feature is actually implemented.
93
102
94
- extension Swift : : D : Swift : : Equatable {
103
+ extension Swift : : D { }
104
+ // FIXME improve: expected-error@-1 {{use of undeclared type 'Swift::D'}}
105
+
106
+ extension D : Swift : : Equatable {
95
107
@_implements ( Swift: : Equatable, Swift: : == ( _: _: ) )
96
108
// expected-error@-1 {{name cannot be qualified with module selector here}} {{34-41=}}
97
109
public static func equals( _: Swift : : D, _: Swift : : D) -> Swift : : Bool { Swift: : fatalError( ) }
@@ -108,7 +120,7 @@ extension Swift::D: Swift::Equatable {
108
120
// expected-error@-1 {{cannot convert value of type '()' to specified type '(Int, Int) -> Int'}}
109
121
// expected-error@-2 {{expected expression}}
110
122
// expected-error@-3 {{expected expression after operator}}
111
- let magnitude : Swift : : Int . Swift : : Magnitude = Swift: : magnitude
123
+ let magnitude : Int . Swift : : Magnitude = Swift: : magnitude
112
124
// expected-EVENTUALLY-error@-1 {{something about not finding 'magnitude' because we didn't look in self}}
113
125
// FIXME: expected-error@-2 {{variable used within its own initial value}}
114
126
if Swift : : Bool. Swift : : rando m( ) {
@@ -130,15 +142,25 @@ struct AvailableUser {
130
142
@available ( macOS 10 . 15 , * ) var use1 : String { " foo " }
131
143
132
144
@main : : available( ) var use2
145
+ // FIXME improve: expected-error@-1 {{unknown attribute 'available'}}
146
+ // FIXME suppress: expected-error@-2 {{type annotation missing in pattern}}
147
+
133
148
@ModuleSelectorTestingKit : : available( ) var use4
149
+ // no-error
150
+
134
151
@Swift : : available( ) var use5
135
- // expected-EVENTUALLY-error@-1 {{can't find because not in 'Swift'}}
152
+ // FIXME improve: expected-error@-1 {{unknown attribute 'available'}}
153
+ // FIXME suppress: expected-error@-2 {{type annotation missing in pattern}}
136
154
}
137
155
138
156
func builderUser2( @main : : MyBuilder fn: ( ) -> Void) { }
157
+ // FIXME improve: expected-error@-1 {{unknown attribute 'MyBuilder'}}
158
+
139
159
func builderUser3 ( @ModuleSelectorTestingKit : : MyBuilder fn: ( ) - > Void) { }
160
+ // no-error
161
+
140
162
func builderUser4( @Swift : : MyBuilder fn: ( ) - > Void) { }
141
- // expected-EVENTUALLY- error@-1 {{can't find because not in 'Swift '}}
163
+ // FIXME improve: expected-error@-1 {{unknown attribute 'MyBuilder '}}
142
164
143
165
func whitespace( ) {
144
166
Swift: : print
@@ -181,10 +203,13 @@ func main::decl1(
181
203
// expected-error@-1 {{name of function declaration cannot be qualified with module selector}}
182
204
main: : p1: main: : A,
183
205
// expected-error@-1 {{argument label cannot be qualified with module selector}}
206
+ // FIXME access path: expected-error@-2 {{use of undeclared type 'main::A'}}
184
207
main: : label p2 : main: : A,
185
208
// expected-error@-1 {{argument label cannot be qualified with module selector}}
209
+ // FIXME access path: expected-error@-2 {{use of undeclared type 'main::A'}}
186
210
label main: : p3: main: : A
187
211
// 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'}}
188
213
) {
189
214
let main : : decl1a = " a "
190
215
// expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
@@ -268,6 +293,7 @@ class main::decl4<main::T> {}
268
293
269
294
typealias main : : decl5 = main : : Bool
270
295
// 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'}}
271
297
272
298
protocol main: : decl6 {
273
299
// expected-error@-1 {{name of protocol declaration cannot be qualified with module selector}}
@@ -308,6 +334,7 @@ struct Parent {
308
334
309
335
typealias main : : decl5 = main : : Bool
310
336
// 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'}}
311
338
}
312
339
313
340
@_swift_native_objc_runtime_base ( main: : BaseClass)
0 commit comments