Skip to content

Commit 5e25550

Browse files
committed
[CodeCompletion] Add test cases for implicitly curried self arg
1 parent 97d7111 commit 5e25550

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/IDE/complete_call_arg.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ERRORCONTEXT_NESTED_1 | %FileCheck %s -check-prefix=ERRORCONTEXT_NESTED_1
7171
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ERRORCONTEXT_NESTED_2 | %FileCheck %s -check-prefix=ERRORCONTEXT_NESTED_1
7272

73+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CURRIED_SELF_1 | %FileCheck %s -check-prefix=CURRIED_SELF_1
74+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CURRIED_SELF_2 | %FileCheck %s -check-prefix=CURRIED_SELF_1
75+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CURRIED_SELF_3 | %FileCheck %s -check-prefix=CURRIED_SELF_1
76+
7377
var i1 = 1
7478
var i2 = 2
7579
var oi1 : Int?
@@ -589,3 +593,16 @@ func testNestedContext() {
589593
for _ in [bar(#^ERRORCONTEXT_NESTED_2^#)] {}
590594
// Same as ERRORCONTEXT_NESTED_1.
591595
}
596+
597+
class TestImplicitlyCurriedSelf {
598+
func foo(x: Int) { }
599+
static func test() {
600+
foo(#^CURRIED_SELF_1^#
601+
self.foo(#^CURRIED_SELF_2^#
602+
TestImplicitlyCurriedSelf.foo(#^CURRIED_SELF_3^#
603+
604+
// CURRIED_SELF_1: Begin completions, 1 items
605+
// CURRIED_SELF_1-DAG: Pattern/CurrModule: ['(']{#(self): TestImplicitlyCurriedSelf#}[')'][#(Int) -> ()#]{{; name=.+$}}
606+
// CURRIED_SELF_1: End completions
607+
}
608+
}

0 commit comments

Comments
 (0)