Skip to content

Commit c17027a

Browse files
committed
[Test] Add failing test.
1 parent 36205d9 commit c17027a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %target-swift-frontend \
2+
// RUN: -disable-availability-checking \
3+
// RUN: -target %target-swift-5.9-abi-triple \
4+
// RUN: -emit-sil -verify \
5+
// RUN: -enable-experimental-feature LifetimeDependence \
6+
// RUN: -enable-experimental-feature Embedded \
7+
// RUN: %s
8+
9+
// REQUIRES: OS=macosx || OS=linux-gnu
10+
// REQUIRES: swift_feature_Embedded
11+
// REQUIRES: swift_feature_LifetimeDependence
12+
13+
// XFAIL: *
14+
15+
struct NoEscapeNoCopy: ~Escapable, ~Copyable {}
16+
17+
protocol Foo {
18+
var bar: NoEscapeNoCopy {get}
19+
}
20+
21+
public struct Baz: Foo {
22+
var bar: NoEscapeNoCopy {
23+
NoEscapeNoCopy() // expected-error{{lifetime-dependent value escapes its scope}}
24+
// expected-note@-1{{it depends on the lifetime of this parent value}}
25+
} // expected-note{{this use causes the lifetime-dependent value to escape}}
26+
}

0 commit comments

Comments
 (0)