|
1 | 1 | // RUN: %target-typecheck-verify-swift -sdk %clang-importer-sdk -module-name main -I %S/Inputs -enable-experimental-module-selector
|
2 | 2 |
|
| 3 | +// FIXME: This only works with ASTScopes, and we might not care about that by the time this feature is ready. |
| 4 | +// RUN-DISABLED: %target-typecheck-verify-swift -sdk %clang-importer-sdk -module-name main -I %S/Inputs -enable-experimental-module-selector -disable-astscope-lookup |
| 5 | + |
3 | 6 | // Make sure the lack of the experimental flag disables the feature:
|
4 | 7 | // RUN: not %target-typecheck-verify-swift -sdk %clang-importer-sdk -module-name main -I %S/Inputs 2>/dev/null
|
5 | 8 |
|
@@ -72,7 +75,7 @@ extension ModuleSelectorTestingKit::C: ModuleSelectorTestingKit::Equatable {
|
72 | 75 | // FIXME: expected-error@-3 {{variable used within its own initial value}}
|
73 | 76 | if ModuleSelectorTestingKit::Bool.ModuleSelectorTestingKit::random() {
|
74 | 77 | ModuleSelectorTestingKit::negate()
|
75 |
| - // expected-EVENTUALLY-error@-1 {{something about not finding 'negate' because we didn't look in self}} |
| 78 | + // FIXME improve, suggest adding 'self.': expected-error@-1 {{use of unresolved identifier 'ModuleSelectorTestingKit::negate'}} |
76 | 79 | }
|
77 | 80 | else {
|
78 | 81 | self = ModuleSelectorTestingKit::C(value: .ModuleSelectorTestingKit::min)
|
@@ -185,61 +188,57 @@ func main::decl1(
|
185 | 188 | ) {
|
186 | 189 | let main::decl1a = "a"
|
187 | 190 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
188 |
| - // expected-warning@-2 {{never used}} |
189 | 191 |
|
190 | 192 | var main::decl1b = "b"
|
191 | 193 | // expected-error@-1 {{name of variable declaration cannot be qualified with module selector}}
|
192 |
| - // expected-warning@-2 {{never used}} |
193 | 194 |
|
194 | 195 | let (main::decl1c, main::decl1d) = ("c", "d")
|
195 | 196 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
196 | 197 | // expected-error@-2 {{name of constant declaration cannot be qualified with module selector}}
|
197 |
| - // expected-warning@-3 2{{never used}} |
198 | 198 |
|
199 | 199 | if let (main::decl1e, main::decl1f) = Optional(("e", "f")) {}
|
200 | 200 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
201 | 201 | // expected-error@-2 {{name of constant declaration cannot be qualified with module selector}}
|
202 |
| - // expected-warning@-3 2{{never used}} |
203 | 202 |
|
204 | 203 | guard let (main::decl1g, main::decl1h) = Optional(("g", "h")) else { return }
|
205 | 204 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
206 | 205 | // expected-error@-2 {{name of constant declaration cannot be qualified with module selector}}
|
207 |
| - // expected-warning@-3 {{never used}} |
208 | 206 |
|
209 |
| - switch Optional(main::decl1g) { // FIXME expecting an error later |
| 207 | + // From uses in the switch statements below: |
| 208 | + // expected-note@-5 3{{did you mean 'decl1g'?}} |
| 209 | + |
| 210 | + switch Optional(main::decl1g) { |
| 211 | + // expected-error@-1 {{use of unresolved identifier 'main::decl1g'}} |
210 | 212 | case Optional.some(let main::decl1i):
|
211 | 213 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
212 |
| - // expected-warning@-2 {{never used}} |
213 | 214 | break
|
214 | 215 | case .none:
|
215 | 216 | break
|
216 | 217 | }
|
217 | 218 |
|
218 |
| - switch Optional(main::decl1g) { // FIXME expecting an error later |
| 219 | + switch Optional(main::decl1g) { |
| 220 | + // expected-error@-1 {{use of unresolved identifier 'main::decl1g'}} |
219 | 221 | case let Optional.some(main::decl1j):
|
220 | 222 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
221 |
| - // expected-warning@-2 {{never used}} |
222 | 223 | break
|
223 | 224 | case .none:
|
224 | 225 | break
|
225 | 226 | }
|
226 | 227 |
|
227 | 228 | switch Optional(main::decl1g) {
|
228 |
| - case let main::decl1k?: |
| 229 | + // expected-error@-1 {{use of unresolved identifier 'main::decl1g'}} |
| 230 | + case let main::decl1k?: |
229 | 231 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
230 |
| - // expected-warning@-2 {{never used}} |
231 | 232 | break
|
232 | 233 | case .none:
|
233 | 234 | break
|
234 | 235 | }
|
235 | 236 |
|
236 | 237 | for main::decl1l in "lll" {}
|
237 | 238 | // expected-error@-1 {{name of constant declaration cannot be qualified with module selector}}
|
238 |
| - // expected-warning@-2 {{never used}} |
239 | 239 |
|
240 | 240 | "lll".forEach { [main::magnitude]
|
241 | 241 | // expected-error@-1 {{name of captured variable declaration cannot be qualified with module selector}}
|
242 |
| - // expected-warning@-2 {{never used}} |
243 | 242 | main::elem in print(elem)
|
244 | 243 | // expected-error@-1 {{name of parameter declaration cannot be qualified with module selector}}
|
245 | 244 | }
|
|
0 commit comments