Add gen test for #4733

This commit is contained in:
Ayaz Hafiz 2022-12-13 12:06:53 -06:00
parent b8aa8df100
commit 1727a9a123
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -2083,3 +2083,26 @@ fn unify_types_with_fixed_fixpoints_outside_fixing_region() {
RocStr
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn 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 (Op Num.add)
Op op = instr
\a -> op a a
main = ((fn "*") 3) * ((fn "+") 5)
"#
),
90,
i64
);
}