mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Put the capture niche in the lambda name instead of generating new names
This commit is contained in:
parent
1ed2e1a8e9
commit
019ebd93f7
20 changed files with 592 additions and 486 deletions
|
@ -1530,19 +1530,18 @@ fn tail_call_with_different_layout() {
|
|||
fn multimorphic_lambda_set_capture() {
|
||||
indoc!(
|
||||
r#"
|
||||
capture : a -> ({} -> Str)
|
||||
capture : _ -> ({} -> Str)
|
||||
capture = \val ->
|
||||
\{} ->
|
||||
when val is
|
||||
_ -> ""
|
||||
Num.toStr val
|
||||
|
||||
x : [True, False]
|
||||
x = True
|
||||
|
||||
fun =
|
||||
when x is
|
||||
True -> capture {}
|
||||
False -> capture ""
|
||||
True -> capture 123u64
|
||||
False -> capture 18u8
|
||||
|
||||
fun {}
|
||||
"#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue