mukul-rathi / bolt

Bolt is a language with in-built data-race freedom!
MIT License
564 stars 51 forks source link

Linearity not preserved across function/method boundaries #63

Closed mukul-rathi closed 4 years ago

mukul-rathi commented 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.
mukul-rathi commented 4 years ago

Solution: check all linear variables are not owned - have been consumed when entering a function scope.

mukul-rathi commented 4 years ago

This is stale - new version of the type system will have borrowing for function args