117
117
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GUARD_LET_BIND_4 | %FileCheck %s -check-prefix=FOOSTRUCT_DOT_BOOL
118
118
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GUARD_LET_BIND_5 | %FileCheck %s -check-prefix=FOOSTRUCT_DOT
119
119
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GUARD_LET_BIND_6 | %FileCheck %s -check-prefix=FOOSTRUCT_NODOT
120
-
120
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GUARD_LET_BIND_7 | %FileCheck %s -check-prefix=FOOSTRUCT_LOCALVAL
121
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GUARD_LET_BIND_8 | %FileCheck %s -check-prefix=FOOSTRUCT_LOCALVAL
121
122
122
123
struct FooStruct {
123
124
var instanceVar : Int
@@ -605,6 +606,13 @@ func testGuardLetBinding5(x: FooStruct?) {
605
606
func testGuardLetBinding5( x: FooStruct? ) {
606
607
guard let y = x, z = y#^GUARD_LET_BIND_6^# else { }
607
608
}
609
+ func testGuardLetBinding7( x: FooStruct? ) {
610
+ guard let boundVal = x, let other = #^GUARD_LET_BIND_7 ^# else { }
611
+ }
612
+ func testGuardLetBinding8( _ x: FooStruct? ) {
613
+ guard let boundVal = x, let other = testGuardLetBinding8 ( #^GUARD_LET_BIND_8 ^#) else { }
614
+ }
615
+
608
616
609
617
// FOOSTRUCT_DOT: Begin completions
610
618
// FOOSTRUCT_DOT-DAG: Decl[InstanceVar]/CurrNominal: instanceVar[#Int#];
@@ -623,3 +631,7 @@ func testGuardLetBinding5(x: FooStruct?) {
623
631
// FOOSTRUCT_NODOT-DAG: Decl[InstanceMethod]/CurrNominal: .boolGen()[#Bool#];
624
632
// FOOSTRUCT_NODOT-DAG: Decl[InstanceMethod]/CurrNominal: .intGen()[#Int#];
625
633
// FOOSTRUCT_NODOT: End completions
634
+
635
+ // FOOSTRUCT_LOCALVAL: Begin completions
636
+ // FOOSTRUCT_LOCALVAL-DAG: Decl[LocalVar]/Local{{(/TypeRelation\[Convertible\])?}}: boundVal[#FooStruct#];
637
+ // FOOSTRUCT_LOCALVAL: End completions
0 commit comments