lang/interpret_test/TestAstFunc2/import-scope-classes1.txtar
raw| 1 | -- main.mcl -- |
| 2 | |
| 3 | class c1() { |
| 4 | $x = "i am x" |
| 5 | } |
| 6 | |
| 7 | class c2() { |
| 8 | include c1 as g1 |
| 9 | |
| 10 | #$y = "i am y" |
| 11 | $z = "i am y and " + $g1.x |
| 12 | } |
| 13 | |
| 14 | include c2 as f1 |
| 15 | |
| 16 | test "${f1.z}" {} # yep |
| 17 | #test "${f1.x}" {} # no |
| 18 | test "${f1.g1.x}" {} # yep |
| 19 | |
| 20 | -- OUTPUT -- |
| 21 | Vertex: test[i am y and i am x] |
| 22 | Vertex: test[i am x] |