Debian Codegraph @

lang/interpret_test/TestAstFunc2/import-scope-classes6.txtar

raw
1 -- main.mcl --
2 $x = "i am x" # i am top-level
3
4 class c2() {
5 $z = "i am y and " + $x
6
7 #$x = $x # not allowed
8 $tmpx = $x # this $x is actually from below, not from the parent scope!
9 #$x = $x + "wow" # allowed?
10 $x = $tmpx + "wow" # circular with itself ($x) in this scope!
11 }
12
13 include c2 as f1
14
15 test "${f1.z}" {}
16 test "${f1.x}" {} # tricky
17 test "${f1.newx}" {}
18
19 -- OUTPUT --
20 # err: errSetScope: recursive reference while setting scope: not a dag