Files
mgmt/lang/interpret_test/TestAstFunc2/scope-ordering-dag2.txtar
James Shubin dd20bd5486 lang: ast: Improve ordering to eliminate false positives
The Ordering and DAG detection code is challenging because we need
Ordering to do SetScope, but Ordering itself needs to know about scopes.
This improved variant should hopefully catch all the scenarios of
identically named variables causing invalid loops.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
2024-01-22 13:19:10 -05:00

14 lines
303 B
Plaintext

-- main.mcl --
# test that ordering works and doesn't produce a dag in this tricky scenario
class foo() {
$y = $x # would this also work with the Ordering(depth) idea?
test $y + "a" {}
}
$x = "hello"
include foo() as c
$z = $c.y
test $z + "b" {}
-- OUTPUT --
Vertex: test[helloa]
Vertex: test[hellob]