Add a gen test for #2535

This commit is contained in:
ayazhafiz 2022-02-20 20:05:15 -05:00
parent dfc384aa1f
commit 475be2363c

View file

@ -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<u8>
);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[should_panic(