18 lines
491 B
Plaintext
18 lines
491 B
Plaintext
-- main.mcl --
|
|
# This sort of thing is not currently supported, and not sure if it ever will.
|
|
|
|
# test generating a function with outside scoping
|
|
$const1 = "hello"
|
|
class funcgen2 {
|
|
func fun2() {
|
|
$const1 + " " + $const2
|
|
}
|
|
}
|
|
$const2 = "world" # added here to confirm any-order rules
|
|
|
|
include funcgen2
|
|
$x2 = fun2() # not funcgen2.fun2 since it's *not* an import!
|
|
test "${x2}" {} # hello world
|
|
-- OUTPUT --
|
|
# err: errSetScope: func `fun2` does not exist in this scope: /main.mcl @ 13:7-13:13
|