mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
Allow uninhabited type extension to happen on either unification side
This commit is contained in:
parent
49ba8b92b4
commit
f96c825aa4
2 changed files with 22 additions and 23 deletions
|
@ -1356,19 +1356,8 @@ fn solve(
|
|||
);
|
||||
|
||||
let snapshot = subs.snapshot();
|
||||
let unify_cond_and_patterns_outcome = {
|
||||
// When unifying the cond type with what the branches expect, we'll want the
|
||||
// branches to gain constructors that are uninabited; that way, we can permit
|
||||
// unification of things like
|
||||
// [Ok Str] ~ [Ok Str, Result []]
|
||||
// which we want here, because `Result []` need not be matched - it is
|
||||
// impossible to construct!
|
||||
//
|
||||
// The order of variables is important here - to do such a unification, the
|
||||
// unifier expects the branch variable on the left, and the condition variable
|
||||
// (containing uninhabited variants to grow by) on the right.
|
||||
unify(&mut UEnv::new(subs), branches_var, real_var, Mode::EQ)
|
||||
};
|
||||
let unify_cond_and_patterns_outcome =
|
||||
unify(&mut UEnv::new(subs), branches_var, real_var, Mode::EQ);
|
||||
|
||||
let should_check_exhaustiveness;
|
||||
match unify_cond_and_patterns_outcome {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue