-- 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