mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Add solve test for same layout different niche
This commit is contained in:
parent
ae410fbf5d
commit
91050d9989
1 changed files with 27 additions and 0 deletions
|
@ -7023,4 +7023,31 @@ mod solve_expr {
|
|||
print_only_under_alias = true,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lambda_set_niche_same_layout_different_constructor() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
capture : a -> ({} -> Str)
|
||||
capture = \val ->
|
||||
thunk =
|
||||
\{} ->
|
||||
when val is
|
||||
_ -> ""
|
||||
thunk
|
||||
|
||||
x : [True, False]
|
||||
|
||||
fun =
|
||||
when x is
|
||||
True -> capture {a: ""}
|
||||
False -> capture (A "")
|
||||
fun
|
||||
#^^^{-1}
|
||||
"#
|
||||
),
|
||||
&["fun : {} -[[thunk(5) [A Str]*, thunk(5) { a : Str }]]-> Str",]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue