Files
mgmt/lang/interpret_test/TestAstFunc2/speculative-call2.txtar
Samuel Gélineau 16dfb7b5f5 lang: Add more test cases related to future graph optimization
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.
2024-01-20 15:01:56 -05:00

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]