class A var _value = 1 pro value from var class B def foo(a as out A?) a = A() .bar(a to !) def bar(a as A) assert a.value a.value = 2 def main is shared a as A? B().foo(out a) assert a.value == 2