Closed mukul-rathi closed 4 years ago
Use a capture checker of sorts - the idea being that new Foo() is an un-captured object, but let x = (new Foo()) is captured (owned by x).
new Foo()
let x = (new Foo())
So check let exprs -> let x = e in ___ is only allowed if either e is not a linear object, or if e is an uncaptured linear object.
let x = e in ___
e
Use a capture checker of sorts - the idea being that
new Foo()
is an un-captured object, butlet x = (new Foo())
is captured (owned by x).So check let exprs ->
let x = e in ___
is only allowed if eithere
is not a linear object, or ife
is an uncaptured linear object.