class A shared pro visitedFoo from var as bool def foo .visitedFoo = true namespace N class B shared pro visitedFoo from var as bool def foo .visitedFoo = true namespace NN class C shared pro visitedFoo from var as bool def foo .visitedFoo = true class P def main assert not A.visitedFoo A().foo assert A.visitedFoo assert not N.B.visitedFoo N.B().foo # code gen used to leave out the .foo call! assert N.B.visitedFoo assert not N.NN.C.visitedFoo N.NN.C().foo # code gen used to leave out the .foo call! assert N.NN.C.visitedFoo