From 0c046476a94be5053fa6af56867688dbbc0bfe8c Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Thu, 18 Nov 2021 22:06:33 -0500 Subject: [PATCH 1/2] Add test case for former issue Closes #1513 --- compiler/test_gen/src/gen_records.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/test_gen/src/gen_records.rs b/compiler/test_gen/src/gen_records.rs index 1c6274e20b..b59641aadd 100644 --- a/compiler/test_gen/src/gen_records.rs +++ b/compiler/test_gen/src/gen_records.rs @@ -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 + ); +} From d29d536990c2ea922693b0abd1f4df41048fb8cd Mon Sep 17 00:00:00 2001 From: ayazhafiz Date: Thu, 18 Nov 2021 23:22:50 -0500 Subject: [PATCH 2/2] Don't test on gen-dev yet --- compiler/test_gen/src/gen_records.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/test_gen/src/gen_records.rs b/compiler/test_gen/src/gen_records.rs index b59641aadd..41babc0e07 100644 --- a/compiler/test_gen/src/gen_records.rs +++ b/compiler/test_gen/src/gen_records.rs @@ -970,7 +970,7 @@ fn update_the_only_field() { } #[test] -#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] // https://github.com/rtfeldman/roc/issues/1513 fn both_have_unique_fields() { assert_evals_to!(