We are planning to implement an optimization in which some function calls are compiled to a single static graph rather than to a CallFunc which dynamically creates a sub-graph at runtime. These test cases exercise corner cases for which it would be theoretically possible to use a static graph, but which we might not be able to optimize.
13 lines
288 B
Plaintext
13 lines
288 B
Plaintext
-- main.mcl --
|
|
$x = "not this x"
|
|
$add = func($x) {
|
|
func($y) {$x + $y}
|
|
}
|
|
$addfoo = $add("foo")
|
|
|
|
# making sure that $x correctly refers to the lambda parameter rather than the
|
|
# top-level "not this x", even in the Value() codepath.
|
|
test $addfoo("bar") {}
|
|
-- OUTPUT --
|
|
Vertex: test[foobar]
|