Closed mukul-rathi closed 4 years ago
consider:
class Bar = linear... {....} function int foo(Bar x, Bar y){ x.f + y.f } let z = new Bar(); foo(z,z); // here have passed same object in, so not linear.
Solution: check all linear variables are not owned - have been consumed when entering a function scope.
This is stale - new version of the type system will have borrowing for function args
consider: