Skip to content

Commit 3e4ab1f

Browse files
committed
[CodeCompletion] Add already fixed test case
rdar://problem/36818556
1 parent 6eed1f9 commit 3e4ab1f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/IDE/complete_in_closures.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_2 | %FileCheck %s -check-prefix=IN_IIFE_1
5656
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_3 | %FileCheck %s -check-prefix=IN_IIFE_1
5757
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_IIFE_4 | %FileCheck %s -check-prefix=IN_IIFE_1
58+
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ERROR_IN_CLOSURE_IN_INITIALIZER | %FileCheck %s -check-prefix=ERROR_IN_CLOSURE_IN_INITIALIZER
5859

5960
// ERROR_COMMON: found code completion token
6061
// ERROR_COMMON-NOT: Begin completions
@@ -369,3 +370,22 @@ func testIIFE() {
369370
// IN_IIFE_1: Begin completions
370371
// IN_IIFE_1-DAG: Decl[EnumElement]/ExprSpecific: north[#SomeEnum#]
371372
// IN_IIFE_1-DAG: Decl[EnumElement]/ExprSpecific: south[#SomeEnum#]
373+
374+
extension Error {
375+
var myErrorNumber: Int { return 0 }
376+
}
377+
378+
class C {
379+
var foo: String = {
380+
do {
381+
} catch {
382+
error.#^ERROR_IN_CLOSURE_IN_INITIALIZER^#
383+
// ERROR_IN_CLOSURE_IN_INITIALIZER: Begin completions
384+
// ERROR_IN_CLOSURE_IN_INITIALIZER-DAG: Keyword[self]/CurrNominal: self[#Error#]; name=self
385+
// ERROR_IN_CLOSURE_IN_INITIALIZER-DAG: Decl[InstanceVar]/CurrNominal: myErrorNumber[#Int#]; name=myErrorNumber
386+
// ERROR_IN_CLOSURE_IN_INITIALIZER: End completions
387+
}
388+
return ""
389+
}()
390+
}
391+

0 commit comments

Comments
 (0)