Skip to content

Commit

Permalink
Add gen tests for #4734
Browse files Browse the repository at this point in the history
Closes #4734
  • Loading branch information
ayazhafiz committed Jan 16, 2023
1 parent 14b9e75 commit 991d5d9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions crates/compiler/test_gen/src/gen_primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4206,3 +4206,49 @@ fn pattern_as_of_symbol() {
bool
);
}

#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn function_specialization_information_in_lambda_set_thunk() {
assert_evals_to!(
indoc!(
r###"
app "test" provides [main] to "./platform"
andThen = \{} ->
x = 10u8
\newFn -> Num.add (newFn {}) x
between = andThen {}
main = between \{} -> between \{} -> 10u8
"###
),
30,
u8
);
}

#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn function_specialization_information_in_lambda_set_thunk_independent_defs() {
assert_evals_to!(
indoc!(
r###"
app "test" provides [main] to "./platform"
andThen = \{} ->
x = 10u8
\newFn -> Num.add (newFn {}) x
between1 = andThen {}
between2 = andThen {}
main = between1 \{} -> between2 \{} -> 10u8
"###
),
30,
u8
);
}

0 comments on commit 991d5d9

Please sign in to comment.