Files
mgmt/lang/interpret_test/TestAstFunc2/test-monomorphic-bind.txtar
James Shubin 8544a66257 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.
2025-03-09 03:03:37 -04:00

15 lines
486 B
Plaintext

-- main.mcl --
# $id could theoretically have type func(int) int or func(str) str, but it
# can't be both because it is bound to a variable, which must have a single
# type.
$id = func($x) {$x}
test "test1" {
int8 => $id(42),
}
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