lang/interpret_test/TestAstFunc1/importscope1.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "second.mcl" |
| 3 | |
| 4 | import "os" # this fixes it but the wrong way |
| 5 | |
| 6 | include second.xclass |
| 7 | -- second.mcl -- |
| 8 | import "fmt" |
| 9 | |
| 10 | class xclass { |
| 11 | # note that `os` is not imported here |
| 12 | $aaa = if os.is_family_debian() { "bbb" } else { "ccc" } |
| 13 | |
| 14 | print "${aaa}" { |
| 15 | msg => "hello", |
| 16 | } |
| 17 | } |
| 18 | -- OUTPUT -- |
| 19 | # err: errSetScope: func `os.is_family_debian` does not exist in this scope |