Add test case for former issue

Closes #1513
This commit is contained in:
ayazhafiz 2021-11-18 22:06:33 -05:00
parent a4fc813ca3
commit 0c046476a9

View file

@ -968,3 +968,24 @@ fn update_the_only_field() {
i64
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
// https://github.com/rtfeldman/roc/issues/1513
fn both_have_unique_fields() {
assert_evals_to!(
indoc!(
r#"
a = { x: 42, y: 43 }
b = { x: 42, z: 44 }
f : { x : I64 }a, { x : I64 }b -> I64
f = \{ x: x1}, { x: x2 } -> x1 + x2
f a b
"#
),
84,
i64
);
}