File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift -enable-experimental-move-only
2+
3+ // This test validates that we do not allow for non-final classes to contain
4+ // move only fields. This is just a temporary measure.
5+
6+ @_moveOnly
7+ struct S {
8+ var i : Int = 5
9+ }
10+
11+ class C {
12+ var s = S ( ) // expected-error {{non-final classes containing move only fields is not yet supported}}
13+ let s1 = S ( ) // expected-error {{non-final classes containing move only fields is not yet supported}}
14+ var s2 : S // expected-error {{non-final classes containing move only fields is not yet supported}}
15+ let s3 : S // expected-error {{non-final classes containing move only fields is not yet supported}}
16+
17+ init ( ) {
18+ s2 = S ( )
19+ s3 = S ( )
20+ }
21+ }
22+
23+ final class C2 {
24+ var s = S ( )
25+ let s1 = S ( )
26+ var s2 : S
27+ let s3 : S
28+
29+ init ( ) {
30+ s2 = S ( )
31+ s3 = S ( )
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments