File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 3
3
// RUN: -verify \
4
4
// RUN: -sil-verify-all \
5
5
// RUN: -module-name test \
6
- // RUN: -enable-experimental-feature NoncopyableGenerics \
7
- // RUN: -enable-experimental-feature NonescapableTypes
6
+ // RUN: -enable-experimental-feature NonescapableTypes \
7
+ // RUN: -enable-experimental-feature NoncopyableGenerics
8
8
9
9
// REQUIRES: asserts
10
10
// REQUIRES: swift_in_compiler
@@ -54,3 +54,15 @@ func bv_get_consume(container: consuming NE) -> BV {
54
54
// expected-note @-2{{this use causes the lifetime-dependent value to escape}}
55
55
}
56
56
57
+ struct Wrapper : ~ Escapable {
58
+ let bv : BV
59
+ }
60
+
61
+ func bv_incorrect_annotation1( _ bv1: borrowing BV , _ bv2: borrowing BV ) -> dependsOn( bv2 ) BV { // expected-error {{lifetime-dependent variable 'bv1' escapes its scope}}
62
+ return copy bv1 // expected-note @-1{{it depends on the lifetime of argument 'bv1'}}
63
+ } // expected-note @-1{{this use causes the lifetime-dependent value to escape}}
64
+
65
+ func bv_incorrect_annotation2( _ w1: borrowing Wrapper , _ w2: borrowing Wrapper ) -> dependsOn( w2 ) BV { // expected-error {{lifetime-dependent variable 'w1' escapes its scope}}
66
+ return w1. bv // expected-note @-1{{it depends on the lifetime of argument 'w1'}}
67
+ } // expected-note @-1{{this use causes the lifetime-dependent value to escape}}
68
+
You can’t perform that action at this time.
0 commit comments