mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
parent
41d7ade5a3
commit
1b2ee9ad30
2 changed files with 18 additions and 0 deletions
|
@ -1847,6 +1847,11 @@ fn open_tag_union(subs: &mut Subs, var: Variable) {
|
||||||
stack.extend(subs.get_subs_slice(fields.variables()));
|
stack.extend(subs.get_subs_slice(fields.variables()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Structure(Tuple(elems, _)) => {
|
||||||
|
// Open up all nested tag unions.
|
||||||
|
stack.extend(subs.get_subs_slice(elems.variables()));
|
||||||
|
}
|
||||||
|
|
||||||
Structure(Apply(Symbol::LIST_LIST, args)) => {
|
Structure(Apply(Symbol::LIST_LIST, args)) => {
|
||||||
// Open up nested tag unions.
|
// Open up nested tag unions.
|
||||||
stack.extend(subs.get_subs_slice(args));
|
stack.extend(subs.get_subs_slice(args));
|
||||||
|
|
|
@ -13170,4 +13170,17 @@ I recommend using camelCase. It's the standard style in Roc code!
|
||||||
I would have to crash if I saw one of those! Add branches for them!
|
I would have to crash if I saw one of those! Add branches for them!
|
||||||
"###
|
"###
|
||||||
);
|
);
|
||||||
|
|
||||||
|
test_no_problem!(
|
||||||
|
openness_constraint_opens_under_tuple,
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
x : [A, B, C]
|
||||||
|
when (x, 1u8) is
|
||||||
|
(A, _) -> Bool.true
|
||||||
|
(B, _) -> Bool.true
|
||||||
|
_ -> Bool.true
|
||||||
|
"#
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue