3
3
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG3 | %FileCheck %s -check-prefix=ARG-NAME2
4
4
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG4 | %FileCheck %s -check-prefix=EXPECT_INT
5
5
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG5 | %FileCheck %s -check-prefix=EXPECT_OSTRING
6
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG6 | %FileCheck %s -check-prefix=ARG-NAME2
7
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG7 | %FileCheck %s -check-prefix=ARG-NAME1
6
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG6 | %FileCheck %s -check-prefix=ARG-NAME3
7
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG7 | %FileCheck %s -check-prefix=ARG-NAME4
8
8
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG8 | %FileCheck %s -check-prefix=EXPECT_STRING
9
9
10
10
// RUN-FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD1 | %FileCheck %s -check-prefix=OVERLOAD1
96
96
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPECHECKED_OVERLOADED | %FileCheck %s -check-prefix=TYPECHECKED_OVERLOADED
97
97
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPECHECKED_TYPEEXPR | %FileCheck %s -check-prefix=TYPECHECKED_TYPEEXPR
98
98
99
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG_PARAMFLAG_INOUT | %FileCheck %s -check-prefix=ARG_PARAMFLAG_INOUT
100
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG_PARAMFLAG_AUTOCLOSURE| %FileCheck %s -check-prefix=ARG_PARAMFLAG_AUTOCLOSURE
101
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG_PARAMFLAG_IUO | %FileCheck %s -check-prefix=ARG_PARAMFLAG_IUO
102
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ARG_PARAMFLAG_VARIADIC | %FileCheck %s -check-prefix=ARG_PARAMFLAG_VARIADIC
103
+
104
+
99
105
var i1 = 1
100
106
var i2 = 2
101
107
var oi1 : Int ?
@@ -171,11 +177,19 @@ class C1 {
171
177
}
172
178
173
179
// ARG-NAME1: Begin completions, 2 items
174
- // ARG-NAME1-DAG: Keyword /ExprSpecific: b1: [#Argument name #]; name=b1:
175
- // ARG-NAME1-DAG: Keyword /ExprSpecific: b2: [#Argument name #]; name=b2:
180
+ // ARG-NAME1-DAG: Pattern /ExprSpecific: {# b1: Int?#}[#Int? #];
181
+ // ARG-NAME1-DAG: Pattern /ExprSpecific: {# b2: Int?#}[#Int? #];
176
182
177
183
// ARG-NAME2: Begin completions, 1 items
178
- // ARG-NAME2-DAG: Keyword/ExprSpecific: b: [#Argument name#]; name=b:
184
+ // ARG-NAME2-DAG: Pattern/ExprSpecific: {#b: Int#}[#Int#];
185
+
186
+ // ARG-NAME3: Begin completions, 1 items
187
+ // ARG-NAME3-DAG: Pattern/ExprSpecific: {#b: String?#}[#String?#];
188
+
189
+ // ARG-NAME4: Begin completions, 2 items
190
+ // ARG-NAME4-DAG: Pattern/ExprSpecific: {#b1: String#}[#String#];
191
+ // ARG-NAME4-DAG: Pattern/ExprSpecific: {#b2: String#}[#String#];
192
+ // ARG-NAME4: End completions
179
193
180
194
// EXPECT_OINT: Begin completions
181
195
// EXPECT_OINT-DAG: Decl[InstanceMethod]/CurrNominal/NotRecommended/TypeRelation[Invalid]: f1()[#Void#]; name=f1()
@@ -336,7 +350,7 @@ extension C3 {
336
350
// HASERROR2: End completions
337
351
338
352
// HASERROR3: Begin completions
339
- // HASERROR3-DAG: Keyword /ExprSpecific: b1: [#Argument name #];
353
+ // HASERROR3-DAG: Pattern /ExprSpecific: {# b1: <<error type>>#}[#<<error type>> #];
340
354
// HASERROR3: End completions
341
355
342
356
// HASERROR4: Begin completions
@@ -464,7 +478,7 @@ func testArg2Name1() {
464
478
func testArg2Name3( ) {
465
479
firstArg( #^FIRST_ARG_NAME_3 ^#,
466
480
}
467
- // FIRST_ARG_NAME_3: Keyword /ExprSpecific: arg1: [#Argument name#]
481
+ // FIRST_ARG_NAME_3: Pattern /ExprSpecific: {# arg1: Int#}[#Int#];
468
482
// FIRST_ARG_NAME_4: Decl[FreeFunction]/CurrModule: ['(']{#arg1: Int#}, {#arg2: Int#}[')'][#Void#];
469
483
470
484
func takeArray< T> ( _ x: [ T ] ) { }
@@ -582,7 +596,7 @@ func testSubscript(obj: HasSubscript, intValue: Int, strValue: String) {
582
596
583
597
let _ = obj[ 42 , #^SUBSCRIPT_2 ^#
584
598
// SUBSCRIPT_2: Begin completions, 1 items
585
- // SUBSCRIPT_2-NEXT: Keyword /ExprSpecific: default: [#Argument name #]; name=default:
599
+ // SUBSCRIPT_2-NEXT: Pattern /ExprSpecific: {# default: String#}[#String #];
586
600
587
601
let _ = obj[ 42 , . #^SUBSCRIPT_2 _DOT^#
588
602
// SUBSCRIPT_2_DOT-NOT: Begin completions
@@ -659,16 +673,16 @@ func testStaticMemberCall() {
659
673
660
674
let _ = TestStaticMemberCall . create2 ( 1 , #^STATIC_METHOD_SECOND^#)
661
675
// STATIC_METHOD_SECOND: Begin completions, 3 items
662
- // STATIC_METHOD_SECOND: Keyword /ExprSpecific: arg2: [#Argument name #];
663
- // STATIC_METHOD_SECOND: Keyword /ExprSpecific: arg3: [#Argument name #];
664
- // STATIC_METHOD_SECOND: Keyword /ExprSpecific: arg4: [#Argument name #];
676
+ // STATIC_METHOD_SECOND: Pattern /ExprSpecific: {# arg2: Int#}[#Int #];
677
+ // STATIC_METHOD_SECOND: Pattern /ExprSpecific: {# arg3: Int#}[#Int #];
678
+ // STATIC_METHOD_SECOND: Pattern /ExprSpecific: {# arg4: Int#}[#Int #];
665
679
// STATIC_METHOD_SECOND: End completions
666
680
667
681
let _ = TestStaticMemberCall . create2 ( 1 , arg3: 2 , #^STATIC_METHOD_SKIPPED^#)
668
682
// STATIC_METHOD_SKIPPED: Begin completions, 2 items
669
683
// FIXME: 'arg3' shouldn't be suggested.
670
- // STATIC_METHOD_SKIPPED: Keyword /ExprSpecific: arg3: [#Argument name #];
671
- // STATIC_METHOD_SKIPPED: Keyword /ExprSpecific: arg4: [#Argument name #];
684
+ // STATIC_METHOD_SKIPPED: Pattern /ExprSpecific: {# arg3: Int#}[#Int #];
685
+ // STATIC_METHOD_SKIPPED: Pattern /ExprSpecific: {# arg4: Int#}[#Int #];
672
686
// STATIC_METHOD_SKIPPED: End completions
673
687
}
674
688
func testImplicitMember( ) {
@@ -687,16 +701,16 @@ func testImplicitMember() {
687
701
688
702
let _: TestStaticMemberCall = . create2( 1 , #^IMPLICIT_MEMBER_SECOND^#)
689
703
// IMPLICIT_MEMBER_SECOND: Begin completions, 3 items
690
- // IMPLICIT_MEMBER_SECOND: Keyword /ExprSpecific: arg2: [#Argument name #];
691
- // IMPLICIT_MEMBER_SECOND: Keyword /ExprSpecific: arg3: [#Argument name #];
692
- // IMPLICIT_MEMBER_SECOND: Keyword /ExprSpecific: arg4: [#Argument name #];
704
+ // IMPLICIT_MEMBER_SECOND: Pattern /ExprSpecific: {# arg2: Int#}[#Int #];
705
+ // IMPLICIT_MEMBER_SECOND: Pattern /ExprSpecific: {# arg3: Int#}[#Int #];
706
+ // IMPLICIT_MEMBER_SECOND: Pattern /ExprSpecific: {# arg4: Int#}[#Int #];
693
707
// IMPLICIT_MEMBER_SECOND: End completions
694
708
695
709
let _: TestStaticMemberCall = . create2( 1 , arg3: 2 , #^IMPLICIT_MEMBER_SKIPPED^#)
696
710
// IMPLICIT_MEMBER_SKIPPED: Begin completions, 2 items
697
711
// FIXME: 'arg3' shouldn't be suggested.
698
- // IMPLICIT_MEMBER_SKIPPED: Keyword /ExprSpecific: arg3: [#Argument name #];
699
- // IMPLICIT_MEMBER_SKIPPED: Keyword /ExprSpecific: arg4: [#Argument name #];
712
+ // IMPLICIT_MEMBER_SKIPPED: Pattern /ExprSpecific: {# arg3: Int#}[#Int #];
713
+ // IMPLICIT_MEMBER_SKIPPED: Pattern /ExprSpecific: {# arg4: Int#}[#Int #];
700
714
// IMPLICIT_MEMBER_SKIPPED: End completions
701
715
}
702
716
func testImplicitMemberInArrayLiteral( ) {
@@ -779,3 +793,26 @@ func testTypecheckedTypeExpr() {
779
793
// TYPECHECKED_TYPEEXPR: Decl[Constructor]/CurrNominal: ['(']{#arg1: String#}, {#arg2: _#}[')'][#MyType<_>#]; name=arg1: String, arg2: _
780
794
// TYPECHECKED_TYPEEXPR: Decl[Constructor]/CurrNominal: ['(']{#(intVal): Int#}[')'][#MyType<Int>#]; name=intVal: Int
781
795
// TYPECHECKED_TYPEEXPR: End completions
796
+
797
+ func testPamrameterFlags( _: Int, inoutArg: inout Int, autoclosureArg: @autoclosure ( ) - > Int, iuoArg: Int!, variadicArg: Int... ) {
798
+ var intVal = 1
799
+ testPamrameterFlags ( intVal, #^ARG_PARAMFLAG_INOUT^#)
800
+ // ARG_PARAMFLAG_INOUT: Begin completions, 1 items
801
+ // ARG_PARAMFLAG_INOUT-DAG: Pattern/ExprSpecific: {#inoutArg: &Int#}[#inout Int#]; name=inoutArg:
802
+ // ARG_PARAMFLAG_INOUT: End completions
803
+
804
+ testPamrameterFlags ( intVal, inoutArg: & intVal, #^ARG_PARAMFLAG_AUTOCLOSURE^#)
805
+ // ARG_PARAMFLAG_AUTOCLOSURE: Begin completions, 1 items
806
+ // ARG_PARAMFLAG_AUTOCLOSURE-DAG: Pattern/ExprSpecific: {#autoclosureArg: Int#}[#Int#];
807
+ // ARG_PARAMFLAG_AUTOCLOSURE: End completions
808
+
809
+ testPamrameterFlags ( intVal, inoutArg: & intVal, autoclosureArg: intVal, #^ARG_PARAMFLAG_IUO^#)
810
+ // ARG_PARAMFLAG_IUO: Begin completions, 1 items
811
+ // ARG_PARAMFLAG_IUO-DAG: Pattern/ExprSpecific: {#iuoArg: Int?#}[#Int?#];
812
+ // ARG_PARAMFLAG_IUO: End completions
813
+
814
+ testPamrameterFlags ( intVal, inoutArg: & intVal, autoclosureArg: intVal, iuoArg: intVal, #^ARG_PARAMFLAG_VARIADIC^#)
815
+ // ARG_PARAMFLAG_VARIADIC: Begin completions, 1 items
816
+ // ARG_PARAMFLAG_VARIADIC-DAG: Pattern/ExprSpecific: {#variadicArg: Int...#}[#Int#];
817
+ // ARG_PARAMFLAG_VARIADIC: End completions
818
+ }
0 commit comments