mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Deduplicate capture niches
This commit is contained in:
parent
91050d9989
commit
3385c708c6
2 changed files with 29 additions and 0 deletions
|
@ -1628,3 +1628,27 @@ fn lambda_capture_niches_have_captured_function_in_closure() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn lambda_set_niche_same_layout_different_constructor() {
|
||||
indoc!(
|
||||
r#"
|
||||
capture : a -> ({} -> Str)
|
||||
capture = \val ->
|
||||
thunk =
|
||||
\{} ->
|
||||
when val is
|
||||
_ -> ""
|
||||
thunk
|
||||
|
||||
x : [True, False]
|
||||
x = True
|
||||
|
||||
fun =
|
||||
when x is
|
||||
True -> capture {a: ""}
|
||||
False -> capture (A "")
|
||||
fun
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue