Skip to content

Commit 67e52e2

Browse files
committed
continuation prior to preemption
Right now, basically zero uses of something of a move-only type are allowed. Plan at this point was to go through CSGen.cpp looking for all calls to ConstraintSystem::createTypeVariable and manually determine whether we should allow a move-only type to be bound to that variable. Places I already expect to not allow it are variables generated for optional-unwrapping expressions, since they're not allowed to appear in optionals for now. What I planned to do was have one expression / case cover each kind of type variable as I go through and add TVO_CanBindToMoveOnly to the options flag set.
1 parent c9d6a6f commit 67e52e2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-typecheck-verify-swift -enable-experimental-move-only
2+
3+
// a concrete move-only type
4+
@_moveOnly struct MO {
5+
var x: Int?
6+
}
7+
8+
@_moveOnly struct Container {
9+
var mo: MO = MO()
10+
}
11+
12+
// utilities
13+
14+
func takeConcrete(_ m: MO) {}
15+
func takeGeneric<T>(_ t: T) {}
16+
17+
// actual tests
18+
19+
//var globalMO: MO = MO()
20+
//let _: MO = globalMO

0 commit comments

Comments
 (0)