lang: unification: Catch unification error on typed if expr
I found a case where we had two missing unification rules. Now fixed in the previous commits, and including this test to show I'm responsible. I've added the same test in two locations for redundancy and as an example.
This commit is contained in:
1
lang/interpret_test/TestAstFunc1/fail2.graph
Normal file
1
lang/interpret_test/TestAstFunc1/fail2.graph
Normal file
@@ -0,0 +1 @@
|
||||
# err: can't unify, invariant illogicality with equality: base kind does not match (2 != 3)
|
||||
9
lang/interpret_test/TestAstFunc1/fail2/main.mcl
Normal file
9
lang/interpret_test/TestAstFunc1/fail2/main.mcl
Normal file
@@ -0,0 +1,9 @@
|
||||
import "fmt"
|
||||
$x str = if true { # should fail unification
|
||||
42
|
||||
} else {
|
||||
13
|
||||
}
|
||||
test "t1" {
|
||||
anotherstr => fmt.printf("hello %s", $x),
|
||||
}
|
||||
Reference in New Issue
Block a user