Merge pull request #2017 from rtfeldman/i/1513

Add test case for former issue
This commit is contained in:
Folkert de Vries 2021-11-19 10:27:53 +01:00 committed by GitHub
commit 71a46166d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -968,3 +968,24 @@ fn update_the_only_field() {
i64 i64
); );
} }
#[test]
#[cfg(any(feature = "gen-llvm", 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
);
}