lang/interpret_test/TestAstFunc2/speculative-call2.txtar
raw| 1 | -- main.mcl -- |
| 2 | $x = "not this x" |
| 3 | $add = func($x) { |
| 4 | func($y) {$x + $y} |
| 5 | } |
| 6 | $addfoo = $add("foo") |
| 7 | |
| 8 | # making sure that $x correctly refers to the lambda parameter rather than the |
| 9 | # top-level "not this x", even in the Value() codepath. |
| 10 | $name = $addfoo("bar") |
| 11 | test "${name}" {} |
| 12 | -- OUTPUT -- |
| 13 | Vertex: test[foobar] |