mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-25 15:33:47 +00:00
Merge pull request #4082 from roc-lang/update-cli-platform-unreachables
Support unification with uninhabited tag variants in more places
This commit is contained in:
commit
cc202a4cf9
4 changed files with 81 additions and 64 deletions
|
@ -1356,16 +1356,8 @@ fn solve(
|
|||
);
|
||||
|
||||
let snapshot = subs.snapshot();
|
||||
let unify_cond_and_patterns_outcome = {
|
||||
// When unifying the cond type with what the branches expect, allow 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!
|
||||
let mode = Mode::EQ_WITH_EXTENSION_BY_UNINHABITED_TYPES;
|
||||
unify(&mut UEnv::new(subs), branches_var, real_var, mode)
|
||||
};
|
||||
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