Skip to content

Commit 4a29db5

Browse files
authored
Merge pull request #77147 from xedin/fixup-issue-desribed-in-77001
[Tests] NFC: Update lifetime tests to avoid overloading on borrowing/…
2 parents cd25c00 + a6f1990 commit 4a29db5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/SILOptimizer/lifetime_dependence/lifetime_dependence_scope_fixup.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ struct View : ~Escapable {
3232
self.ptr = k.ptr
3333
self.c = k.c
3434
}
35-
init(_ k: consuming View) {
35+
// This overload requires a separate label because overloading
36+
// on borrowing/consuming attributes is not allowed
37+
init(consumingView k: consuming View) {
3638
self.ptr = k.ptr
3739
self.c = k.c
3840
}
@@ -65,7 +67,7 @@ func consume(_ o : consuming MutableView) {}
6567

6668
@lifetime(x)
6769
func getConsumingView(_ x: consuming View) -> View {
68-
return View(x)
70+
return View(consumingView: x)
6971
}
7072

7173
@lifetime(borrow x)

0 commit comments

Comments
 (0)