mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Add gen test for other #4733 reproducer
This commit is contained in:
parent
0a071e2a98
commit
f08d9c9173
1 changed files with 27 additions and 0 deletions
|
@ -2106,3 +2106,30 @@ fn lambda_set_with_imported_toplevels_issue_4733() {
|
|||
i64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn non_unary_union_with_lambda_set_with_imported_toplevels_issue_4733() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
fn = \s ->
|
||||
instr =
|
||||
if s == "*" then (Op Num.mul)
|
||||
else if s == "+" then (Op Num.add)
|
||||
else Noop
|
||||
|
||||
when instr is
|
||||
Op op -> (\a -> op a a)
|
||||
_ -> (\a -> a)
|
||||
|
||||
|
||||
main = ((fn "*") 3) * ((fn "+") 5)
|
||||
"#
|
||||
),
|
||||
90,
|
||||
i64
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue