Add mono tests for function-specialization information preserved in lambda sets

This commit is contained in:
Ayaz Hafiz 2023-01-16 12:04:31 -06:00
parent 3109b2b00f
commit 011c2ffd47
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 138 additions and 0 deletions

View file

@ -2408,3 +2408,43 @@ fn pattern_as_of_symbol() {
"###
)
}
#[mono_test]
fn function_specialization_information_in_lambda_set_thunk() {
// https://github.com/roc-lang/roc/issues/4734
// https://rwx.notion.site/Let-generalization-Let-s-not-742a3ab23ff742619129dcc848a271cf#6b08b0a203fb443db2d7238a0eb154eb
indoc!(
r###"
app "test" provides [main] to "./platform"
andThen = \{} ->
x = 10
\newFn -> Num.add (newFn {}) x
between = andThen {}
main = between \{} -> between \{} -> 10
"###
)
}
#[mono_test]
fn function_specialization_information_in_lambda_set_thunk_independent_defs() {
// https://github.com/roc-lang/roc/issues/4734
// https://rwx.notion.site/Let-generalization-Let-s-not-742a3ab23ff742619129dcc848a271cf#6b08b0a203fb443db2d7238a0eb154eb
indoc!(
r###"
app "test" provides [main] to "./platform"
andThen = \{} ->
x = 10u8
\newFn -> Num.add (newFn {}) x
between1 = andThen {}
between2 = andThen {}
main = between1 \{} -> between2 \{} -> 10u8
"###
)
}