Skip to content

Commit 90021dd

Browse files
committed
Add a test for unsupported lifetime dependencies on params.
1 parent bd7d3ec commit 90021dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/Sema/lifetime_attr.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ do {
5959
t[keyPath: \.v2] // expected-error {{key path cannot refer to nonescapable type 'Test'}} expected-error {{key path cannot refer to nonescapable type 'NE'}}
6060
}
6161
}
62+
63+
// rdar://146401190 ([nonescapable] implement non-inout parameter dependencies)
64+
@lifetime(span: borrow holder)
65+
func testParameterDep(holder: Holder, span: Span<Int>) {} // expected-error {{lifetime-dependent parameter must be 'inout'}}

0 commit comments

Comments
 (0)