lang/interpret_test/TestAstFunc2/func-gen1.txtar
raw| 1 | -- main.mcl -- |
| 2 | # This sort of thing is not currently supported, and not sure if it ever will. |
| 3 | |
| 4 | # test generating a function |
| 5 | class funcgen1 { |
| 6 | func fun1() { |
| 7 | "hi" |
| 8 | } |
| 9 | } |
| 10 | include funcgen1 |
| 11 | $x1 = fun1() # not funcgen1.fun1 since it's *not* an import! |
| 12 | test "${x1}" {} # hi |
| 13 | -- OUTPUT -- |
| 14 | # err: errSetScope: func `fun1` does not exist in this scope |