Type checking test for > guard expression
@@ -660,6 +660,24 @@ fn infer_error_test() {
},
);
+ assert_error!(
+ "case [3.33], 1 { x, y if x > y -> 1 }",
+ Error::CouldNotUnify {
+ location: SrcSpan { start: 25, end: 26 },
+ expected: int(),
+ given: list(float())
+ }
+ );
+
+ assert_error!(
+ "case 1, 2.22, \"three\" { x, _, y if x > y -> 1 }",
+ Error::CouldNotUnify {
+ location: SrcSpan { start: 39, end: 40 },
+ expected: int(),
+ given: string()
+ }
+ );
+
assert_error!(
"case [1] { [x] | x -> 1 }",
Error::CouldNotUnify {
