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