diff --git a/crates/compiler/solve/src/solve.rs b/crates/compiler/solve/src/solve.rs index 89097cf9d2..c0bd6eb27d 100644 --- a/crates/compiler/solve/src/solve.rs +++ b/crates/compiler/solve/src/solve.rs @@ -1847,6 +1847,11 @@ fn open_tag_union(subs: &mut Subs, var: Variable) { 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)) => { // Open up nested tag unions. stack.extend(subs.get_subs_slice(args)); diff --git a/crates/reporting/tests/test_reporting.rs b/crates/reporting/tests/test_reporting.rs index a50debc07c..06c770f122 100644 --- a/crates/reporting/tests/test_reporting.rs +++ b/crates/reporting/tests/test_reporting.rs @@ -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! "### ); + + 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 + "# + ) + ); }