pgraph, lang: ast: Fix failing tests due to non-deterministic topo sort

This causes inconsistent type unification when running our tests. It's a
bad user experience too.
This commit is contained in:
James Shubin
2024-07-01 18:34:24 -04:00
parent 14577a0c46
commit f2976deb02
5 changed files with 66 additions and 5 deletions

View File

@@ -17,4 +17,4 @@ $out2 = $add($val) # hellohello
test [fmt.printf("%s + %s is %s", $val, $val, $out2),] {} # simple concat
-- OUTPUT --
# err: errUnify: unify error with: topLevel(singleton(func(x) { call:_operator(str("+"), var(x), var(x)) })): type error: Str != Int
# err: errUnify: unify error with: topLevel(singleton(func(x) { call:_operator(str("+"), var(x), var(x)) })): type error: Int != Str

View File

@@ -10,4 +10,4 @@ test "test2" {
anotherstr => $id("hello"),
}
-- OUTPUT --
# err: errUnify: unify error with: topLevel(singleton(func(x) { var(x) })): type error: Str != Int
# err: errUnify: unify error with: topLevel(singleton(func(x) { var(x) })): type error: Int != Str

View File

@@ -12,4 +12,4 @@ class use_polymorphically($id) {
}
include use_polymorphically(func($x) {$x})
-- OUTPUT --
# err: errUnify: unify error with: topLevel(singleton(func(x) { var(x) })): type error: Str != Int
# err: errUnify: unify error with: topLevel(singleton(func(x) { var(x) })): type error: Int != Str