mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Don't suggest removing variable when it's bound in a branch pattern
Instead, suggest prefixing it with an underscore, or replacing with an underscore. Closes #3820
This commit is contained in:
parent
34c3f266e0
commit
b30c90b500
4 changed files with 47 additions and 4 deletions
|
@ -1414,7 +1414,7 @@ fn canonicalize_when_branch<'a>(
|
|||
if output.references.has_value_lookup(symbol) {
|
||||
pattern_bound_symbols_body_needs.insert(symbol);
|
||||
} else {
|
||||
env.problem(Problem::UnusedDef(symbol, region));
|
||||
env.problem(Problem::UnusedBranchDef(symbol, region));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue