75
75
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TUPLE_1 | %FileCheck %s -check-prefix=IN_TUPLE_1
76
76
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TUPLE_2 | %FileCheck %s -check-prefix=IN_TUPLE_2
77
77
78
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_1 | %FileCheck %s -check-prefix=OWN_INIT_1
79
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_2 | %FileCheck %s -check-prefix=OWN_INIT_2
80
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_3 | %FileCheck %s -check-prefix=OWN_INIT_3
81
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_4 | %FileCheck %s -check-prefix=OWN_INIT_4
82
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_5 | %FileCheck %s -check-prefix=OWN_INIT_5
83
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_6 | %FileCheck %s -check-prefix=OWN_INIT_6
84
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_7 | %FileCheck %s -check-prefix=OWN_INIT_7
85
+
78
86
//
79
87
// Test code completion at the beginning of expr-postfix.
80
88
//
@@ -435,8 +443,7 @@ func testInForEach1(arg: Int) {
435
443
let after = 4
436
444
// IN_FOR_EACH_1-NOT: Decl[LocalVar]
437
445
// IN_FOR_EACH_1: Decl[LocalVar]/Local: local[#Int#];
438
- // FIXME: shouldn't show 'after' here.
439
- // IN_FOR_EACH_1: Decl[LocalVar]/Local: after[#Int#];
446
+ // IN_FOR_EACH_1-NOT: after
440
447
// IN_FOR_EACH_1: Decl[LocalVar]/Local: arg[#Int#];
441
448
// IN_FOR_EACH_1-NOT: Decl[LocalVar]
442
449
}
@@ -448,8 +455,7 @@ func testInForEach2(arg: Int) {
448
455
let after = 4
449
456
// IN_FOR_EACH_2-NOT: Decl[LocalVar]
450
457
// IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: local[#Int#];
451
- // FIXME: shouldn't show 'after' here.
452
- // IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: after[#Int#];
458
+ // IN_FOR_EACH_2-NOT: after
453
459
// IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: arg[#Int#];
454
460
// IN_FOR_EACH_2-NOT: Decl[LocalVar]
455
461
}
@@ -463,8 +469,7 @@ func testInForEach3(arg: Int) {
463
469
// IN_FOR_EACH_3: Decl[LocalVar]/Local: index[#Int#];
464
470
// IN_FOR_EACH_3-NOT: Decl[LocalVar]
465
471
// IN_FOR_EACH_3: Decl[LocalVar]/Local: local[#Int#];
466
- // FIXME: shouldn't show 'after' here.
467
- // IN_FOR_EACH_3: Decl[LocalVar]/Local: after[#Int#];
472
+ // IN_FOR_EACH_3-NOT: after
468
473
// IN_FOR_EACH_3: Decl[LocalVar]/Local: arg[#Int#];
469
474
// IN_FOR_EACH_3-NOT: Decl[LocalVar]
470
475
}
@@ -503,8 +508,7 @@ func testInForEach9(arg: Int) {
503
508
// NOTE: [Convertible] to AnyHashable.
504
509
// IN_FOR_EACH_4-NOT: Decl[LocalVar]
505
510
// IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: local[#Int#];
506
- // FIXME: shouldn't show 'after' here.
507
- // IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: after[#Int#];
511
+ // IN_FOR_EACH_4-NOT: after
508
512
// IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: arg[#Int#];
509
513
// IN_FOR_EACH_4-NOT: Decl[LocalVar]
510
514
}
@@ -555,3 +559,31 @@ func testTuple(localInt: Int) {
555
559
// IN_TUPLE_2: Decl[LocalVar]/Local: localStr[#String#]; name=localStr
556
560
// IN_TUPLE_2: Decl[LocalVar]/Local/TypeRelation[Identical]: localInt[#Int#]; name=localInt
557
561
// IN_TUPLE_2: End completions
562
+
563
+ var ownInit1: Int = #^OWN_INIT_1^#
564
+ // OWN_INIT_1: Begin completions
565
+ // OWN_INIT_1-NOT: ownInit1
566
+ var ownInit2: () -> Void = { #^OWN_INIT_2^# }
567
+ // OWN_INIT_2: Begin completions
568
+ // OWN_INIT_2-NOT: ownInit2
569
+ struct OwnInitTester {
570
+ var ownInit3: Int = #^OWN_INIT_3^#
571
+ // OWN_INIT_3: Begin completions
572
+ // OWN_INIT_3-NOT: ownInit3
573
+ var ownInit4: () -> Void = { #^OWN_INIT_4^# }
574
+ // OWN_INIT_4: Begin completions
575
+ // OWN_INIT_4-NOT: ownInit4
576
+ }
577
+ func ownInitTesting() {
578
+ var ownInit5: Int = #^OWN_INIT_5^#
579
+ // OWN_INIT_5: Begin completions
580
+ // OWN_INIT_5-NOT: ownInit5
581
+ var ownInit6: () -> Void = { #^OWN_INIT_6^# }
582
+ // OWN_INIT_6: Begin completions
583
+ // OWN_INIT_6-NOT: ownInit6
584
+ }
585
+ func ownInitTestingShadow(ownInit7: Int) {
586
+ var ownInit7: Int = #^OWN_INIT_7^#
587
+ // OWN_INIT_7: Begin completions
588
+ // OWN_INIT_7: Decl[LocalVar]/Local/TypeRelation[Identical]: ownInit7[#Int#];
589
+ }
0 commit comments