Skip to content

Commit e8d2d02

Browse files
committed
[borrow-keyword] Add some more small tests to show we can call methods on _borrow self and chain into methods.
1 parent 9479192 commit e8d2d02

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Sema/borrow_expr.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@ func testVar() {
2121
t = String()
2222
useString(_borrow t)
2323
}
24+
25+
struct S {
26+
var k = Klass()
27+
28+
func test() {}
29+
30+
func test2() {
31+
(_borrow self).test()
32+
}
33+
}
34+
35+
func useApply() {
36+
var s = S()
37+
s = S()
38+
(_borrow s).test()
39+
}

0 commit comments

Comments
 (0)