You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to assign a borrowed variable to another variable declared outside of the borrowing scope:
read trait Hello
def hello() : unit
println("Hello, World!")
end
end
linear class Foo : Hello
end
active class Main
def main() : unit
var x = new Foo
var z = null : borrowed Foo
borrow x as y in
z = y -- This assignment should not be allowed!
end
-- z is now an alias of (the supposedly linear) x
z.hello()
x.hello()
end
end
The text was updated successfully, but these errors were encountered:
It is possible to assign a borrowed variable to another variable declared outside of the borrowing scope:
The text was updated successfully, but these errors were encountered: