Skip to content

Commit bfa1015

Browse files
committed
[CodeComplete] Add test case for completing in inout arguments
This captures a crash found in rdar://74786497 that no longer occurs in `main`.
1 parent b0bade6 commit bfa1015

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/IDE/complete_inout.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
3+
4+
struct Bar() {
5+
init?(withInout: inout Int) {}
6+
init?(withPointer: UnsafePointer<Int>) {}
7+
}
8+
9+
struct Foo {
10+
var myInt: Int
11+
12+
func bar() {
13+
let context = Bar(wihtInout: &self.#^COMPLETE_INOUT?check=CHECK^#)
14+
let context = Bar(withPointer: &self.#^COMPLETE_POINTER?check=CHECK^#)
15+
}
16+
}
17+
18+
// CHECK: Decl[InstanceVar]/CurrNominal: myInt[#Int#]; name=myInt

0 commit comments

Comments
 (0)