- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathimport-specific-decl.swift
25 lines (19 loc) · 928 Bytes
/
import-specific-decl.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/asdf.swift
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/abcde.swift
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/aeiou.swift
// RUN: %target-swift-frontend -typecheck %s -I %t -sdk "" -verify
// RUN: not %target-swift-frontend -typecheck %s -I %t -sdk "" 2>&1 | %FileCheck %s
importstruct aeiou.U
importstruct aeiou.E
import abcde
import asdf
vara:A // expected-error {{'A' is ambiguous for type lookup in this context}}
// CHECK: error: 'A' is ambiguous for type lookup in this context
// CHECK-DAG: abcde{{.+}}note: found this candidate
// CHECK-DAG: asdf{{.+}}note: found this candidate
varb:B= abcde.B()
vare:E= aeiou.E()
varu:U= aeiou.U()
varo:O // expected-error {{cannot find type 'O' in scope}}
varo2= aeiou.O() // expected-error {{module 'aeiou' has no member named 'O'}}