Add suggestion to remove if in let...else block
Adds an additional hint to failures where we encounter an else keyword while we're parsing an if-let block. This is likely that the user has accidentally mixed if-let and let...else together.
This commit is contained in:
parent
c8e6a9e8b6
commit
a8b77cfe54
6 changed files with 61 additions and 14 deletions
|
@ -238,6 +238,7 @@ parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
|
|||
|
||||
parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
|
||||
parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
|
||||
parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement
|
||||
|
||||
parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
|
||||
.suggestion = initialize the variable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue