mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 15:03:46 +00:00
Construct exhaustiveness branches with condition, not branch, variable
Previously we would construct the shapes of unions used in the pattern tree for exhaustiveness checking using the type of the branch patterns, rather than the type of the condition variable. Clearly we want to always use the condition variable, otherwise some branches will be seen as exhaustive, when they are not! To do this, we now index into the condition variable while refying the patterns to build the tree for exhaustiveness checking. Closes #4068
This commit is contained in:
parent
0f0e414272
commit
1799d6ed0e
4 changed files with 203 additions and 57 deletions
|
@ -1480,7 +1480,7 @@ fn solve(
|
|||
errors,
|
||||
exhaustive,
|
||||
redundancies,
|
||||
} = check(subs, sketched_rows, context);
|
||||
} = check(subs, real_var, sketched_rows, context);
|
||||
|
||||
// Store information about whether the "when" is exhaustive, and
|
||||
// which (if any) of its branches are redundant. Codegen may use
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue