mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
represent bool closure as unit
This commit is contained in:
parent
6741d93517
commit
441eb02ca3
3 changed files with 50 additions and 32 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue