mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
improve error reporting for underscore expr
This commit is contained in:
parent
46ab922dd1
commit
2bb1f2cca7
6 changed files with 93 additions and 12 deletions
|
@ -14,6 +14,12 @@ pub struct CycleEntry {
|
|||
pub expr_region: Region,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum BadPattern {
|
||||
UnderscoreInDef,
|
||||
Unsupported(PatternType),
|
||||
}
|
||||
|
||||
/// Problems that can occur in the course of canonicalization.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Problem {
|
||||
|
@ -25,7 +31,7 @@ pub enum Problem {
|
|||
UnusedArgument(Symbol, Symbol, Region),
|
||||
PrecedenceProblem(PrecedenceProblem),
|
||||
// Example: (5 = 1 + 2) is an unsupported pattern in an assignment; Int patterns aren't allowed in assignments!
|
||||
UnsupportedPattern(PatternType, Region),
|
||||
UnsupportedPattern(BadPattern, Region),
|
||||
ShadowingInAnnotation {
|
||||
original_region: Region,
|
||||
shadow: Located<Ident>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue