mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Mark branch patterns degenerate when they don't bind symbols body needs
This commit is contained in:
parent
ed6ee71225
commit
4031770836
11 changed files with 110 additions and 32 deletions
|
@ -323,9 +323,13 @@ pub fn walk_when_branch<V: Visitor>(
|
|||
redundant: _,
|
||||
} = branch;
|
||||
|
||||
patterns
|
||||
.iter()
|
||||
.for_each(|pat| visitor.visit_pattern(&pat.value, pat.region, pat.value.opt_var()));
|
||||
patterns.iter().for_each(|pat| {
|
||||
visitor.visit_pattern(
|
||||
&pat.pattern.value,
|
||||
pat.pattern.region,
|
||||
pat.pattern.value.opt_var(),
|
||||
)
|
||||
});
|
||||
visitor.visit_expr(&value.value, value.region, expr_var);
|
||||
if let Some(guard) = guard {
|
||||
visitor.visit_expr(&guard.value, guard.region, Variable::BOOL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue