File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
2+
3+ enum E {
4+ case bar
5+ case foo
6+ }
7+
8+ func test( pred: Bool ) {
9+ var e : E
10+ if pred {
11+ e = . #^THEN? check= CHECK^#
12+ } else {
13+ e = . #^ELEE? check= CHECK^#
14+ }
15+
16+ do {
17+ e = . #^DO? check= CHECK^#
18+ } catch e {
19+ e = . #^CATCH? check= CHECK^#
20+ }
21+
22+ switch pred {
23+ case true :
24+ e = . #^CASE_1 ? check= CHECK^#
25+ break ;
26+ case false :
27+ e = . #^CASE_2 ? check= CHECK^#
28+ break ;
29+ default :
30+ e = . #^DEFAULT? check= CHECK^#
31+ break ;
32+ }
33+ }
34+
35+ // CHECK: Begin completions, 3 items
36+ // CHECK: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: bar[#E#]; name=bar
37+ // CHECK: Decl[EnumElement]/ExprSpecific/TypeRelation[Identical]: foo[#E#]; name=foo
38+ // CHECK: Decl[InstanceMethod]/CurrNominal/TypeRelation[Invalid]: hash({#(self): E#})[#(into: inout Hasher) -> Void#]; name=hash(self: E)
39+ // CHECK: End completions
You can’t perform that action at this time.
0 commit comments