lang: Allow more than one possible error in tests

There are some rare situations with completely symmetrical graphs which
mean that there isn't a "more correct" error. This is due to the
annoying map iteration non-determinism, and so instead of fighting to
remove every bit of that, let's just accept more than one error here.
This commit is contained in:
James Shubin
2025-03-09 03:03:37 -04:00
parent a50765393d
commit 8544a66257
4 changed files with 112 additions and 23 deletions

View File

@@ -18,3 +18,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

@@ -11,3 +11,4 @@ test "test2" {
}
-- 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

@@ -13,3 +13,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