Files
mgmt/lang/interpret_test/TestAstFunc2/test-monomorphic-bind.txtar
James Shubin f2976deb02 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.
2024-07-01 18:34:24 -04:00

14 lines
387 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: Int != Str