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>
14 lines
303 B
Plaintext
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]
|