Add gen test for other #4733 reproducer

This commit is contained in:
Ayaz Hafiz 2022-12-13 12:10:08 -06:00
parent 0a071e2a98
commit f08d9c9173
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -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
);
}