represent bool closure as unit

This commit is contained in:
Folkert 2021-08-14 15:54:05 +02:00
parent 6741d93517
commit 441eb02ca3
3 changed files with 50 additions and 32 deletions

View file

@ -2552,3 +2552,27 @@ fn mirror_llvm_alignment_padding() {
RocStr
);
}
#[test]
fn code_gen_unified_closure() {
assert_evals_to!(
indoc!(
r#"
app "test" provides [ main ] to "./platform"
p1 = (\u -> u == 97)
p2 = (\u -> u == 98)
main : I64
main =
oneOfResult = List.map [p1, p2] (\p -> p 42)
when oneOfResult is
_ -> 32
"#
),
32,
i64
);
}