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:
Ayaz Hafiz 2022-08-17 11:53:01 -05:00
parent 34c3f266e0
commit b30c90b500
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 47 additions and 4 deletions

View file

@ -38,6 +38,7 @@ pub enum Problem {
/// Bool is whether the closure is anonymous
/// Second symbol is the name of the argument that is unused
UnusedArgument(Symbol, bool, Symbol, Region),
UnusedBranchDef(Symbol, Region),
PrecedenceProblem(PrecedenceProblem),
// Example: (5 = 1 + 2) is an unsupported pattern in an assignment; Int patterns aren't allowed in assignments!
UnsupportedPattern(BadPattern, Region),