mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Get multimorphic lambda captures working
This commit is contained in:
parent
88618c098d
commit
8be230695b
9 changed files with 458 additions and 423 deletions
|
@ -1527,24 +1527,22 @@ fn tail_call_with_different_layout() {
|
|||
}
|
||||
|
||||
#[mono_test]
|
||||
#[ignore]
|
||||
fn lambda_sets_collide_with_captured_var() {
|
||||
fn multimorphic_lambda_set_capture() {
|
||||
indoc!(
|
||||
r#"
|
||||
capture : a -> ({} -> Str)
|
||||
capture = \val ->
|
||||
thunk =
|
||||
\{} ->
|
||||
when val is
|
||||
_ -> ""
|
||||
thunk
|
||||
\{} ->
|
||||
when val is
|
||||
_ -> ""
|
||||
|
||||
x : [True, False]
|
||||
x = True
|
||||
|
||||
fun =
|
||||
when x is
|
||||
True -> capture 1u8
|
||||
False -> capture 1u64
|
||||
True -> capture {}
|
||||
False -> capture ""
|
||||
|
||||
fun {}
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue