Multimorphic lambdas capture another lambda

This commit is contained in:
Ayaz Hafiz 2022-06-28 18:28:15 -04:00 committed by ayazhafiz
parent b69d538ea0
commit 28c1cf46a3
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
5 changed files with 175 additions and 63 deletions

View file

@ -1600,3 +1600,32 @@ fn multimorphic_lambdas_with_non_capturing_function() {
"#
)
}
#[mono_test]
fn multimorphic_lambdas_have_captured_function_in_closure() {
indoc!(
r#"
Lazy a : {} -> a
after : Lazy a, (a -> Lazy b) -> Lazy b
after = \effect, map ->
thunk = \{} ->
when map (effect {}) is
b -> b {}
thunk
f = \_ -> \_ -> ""
g = \{ s1 } -> \_ -> s1
x : [True, False]
x = True
fun =
when x is
True -> after (\{} -> "") f
False -> after (\{} -> {s1: "s1"}) g
fun {}
"#
)
}