Make sure to properly preserve lambda set ordering

This commit is contained in:
Ayaz Hafiz 2022-06-28 18:14:09 -04:00 committed by ayazhafiz
parent 1903ce4db9
commit 806e2f5096
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
3 changed files with 115 additions and 13 deletions

View file

@ -1548,3 +1548,55 @@ fn multimorphic_lambda_set_capture() {
"#
)
}
#[mono_test]
fn multimorphic_lambdas_with_other_lambda_capture() {
indoc!(
r#"
capture : a -> ({} -> Str)
capture = \val ->
\{} ->
when val is
_ -> ""
capture2 = \val -> \{} -> "\(val)"
x : [A, B, C]
x = A
fun =
when x is
A -> capture {}
B -> capture2 "foo"
C -> capture 1u64
fun {}
"#
)
}
#[mono_test]
fn multimorphic_lambdas_with_non_capturing_function() {
indoc!(
r#"
capture : a -> ({} -> Str)
capture = \val ->
\{} ->
when val is
_ -> ""
triv = \{} -> ""
x : [A, B, C]
x = A
fun =
when x is
A -> capture {}
B -> triv
C -> capture 1u64
fun {}
"#
)
}