diff --git a/compiler/test_gen/src/gen_records.rs b/compiler/test_gen/src/gen_records.rs index 5377da5afc..d10f846d43 100644 --- a/compiler/test_gen/src/gen_records.rs +++ b/compiler/test_gen/src/gen_records.rs @@ -13,6 +13,9 @@ use crate::helpers::wasm::assert_evals_to; // use crate::assert_wasm_evals_to as assert_evals_to; use indoc::indoc; +#[cfg(test)] +use roc_std::RocList; + #[test] #[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))] fn basic_record() { @@ -1007,6 +1010,30 @@ fn both_have_unique_fields() { ); } +#[test] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] +// https://github.com/rtfeldman/roc/issues/2535 +fn different_proc_types_specialized_to_same_layout() { + assert_evals_to!( + indoc!( + r#" + app "test" provides [ nums ] to "./platform" + + alpha = { a: 1, b: 2 } + + nums : List U8 + nums = + [ + alpha.a, + alpha.b, + ] + "# + ), + RocList::from_slice(&[1, 2]), + RocList + ); +} + #[test] #[cfg(any(feature = "gen-llvm"))] #[should_panic(