mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Merge pull request #2917 from rtfeldman/move-exhaustiveness-checking
Moves exhaustiveness checking to type solving phase
This commit is contained in:
commit
6da39aa296
21 changed files with 1067 additions and 177 deletions
|
@ -2091,6 +2091,7 @@ fn pattern_to_when<'a>(
|
|||
value: body,
|
||||
guard: None,
|
||||
}],
|
||||
branches_cond_var: pattern_var,
|
||||
};
|
||||
|
||||
(symbol, Loc::at_zero(wrapped_body))
|
||||
|
@ -3753,6 +3754,7 @@ pub fn with_hole<'a>(
|
|||
region,
|
||||
loc_cond,
|
||||
branches,
|
||||
branches_cond_var: _,
|
||||
} => {
|
||||
let cond_symbol = possible_reuse_symbol(env, procs, &loc_cond.value);
|
||||
|
||||
|
@ -5443,6 +5445,7 @@ pub fn from_can<'a>(
|
|||
region,
|
||||
loc_cond,
|
||||
branches,
|
||||
branches_cond_var: _,
|
||||
} => {
|
||||
let cond_symbol = possible_reuse_symbol(env, procs, &loc_cond.value);
|
||||
|
||||
|
@ -5844,7 +5847,7 @@ fn to_opt_branches<'a>(
|
|||
Ok((mono_pattern, assignments)) => {
|
||||
loc_branches.push((
|
||||
Loc::at(loc_pattern.region, mono_pattern.clone()),
|
||||
exhaustive_guard.clone(),
|
||||
exhaustive_guard,
|
||||
));
|
||||
|
||||
let mut loc_expr = when_branch.value.clone();
|
||||
|
@ -5874,7 +5877,7 @@ fn to_opt_branches<'a>(
|
|||
Err(runtime_error) => {
|
||||
loc_branches.push((
|
||||
Loc::at(loc_pattern.region, Pattern::Underscore),
|
||||
exhaustive_guard.clone(),
|
||||
exhaustive_guard,
|
||||
));
|
||||
|
||||
// TODO remove clone?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue