mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Improve shadow errors
This commit is contained in:
parent
13a17f1858
commit
94a5cd3559
8 changed files with 57 additions and 21 deletions
|
@ -20,6 +20,14 @@ pub enum BadPattern {
|
|||
Unsupported(PatternType),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum ShadowKind {
|
||||
Variable,
|
||||
Alias,
|
||||
Opaque,
|
||||
Ability,
|
||||
}
|
||||
|
||||
/// Problems that can occur in the course of canonicalization.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Problem {
|
||||
|
@ -33,9 +41,10 @@ pub enum Problem {
|
|||
PrecedenceProblem(PrecedenceProblem),
|
||||
// Example: (5 = 1 + 2) is an unsupported pattern in an assignment; Int patterns aren't allowed in assignments!
|
||||
UnsupportedPattern(BadPattern, Region),
|
||||
ShadowingInAnnotation {
|
||||
Shadowing {
|
||||
original_region: Region,
|
||||
shadow: Loc<Ident>,
|
||||
kind: ShadowKind,
|
||||
},
|
||||
CyclicAlias(Symbol, Region, Vec<Symbol>),
|
||||
BadRecursion(Vec<CycleEntry>),
|
||||
|
@ -181,6 +190,7 @@ pub enum RuntimeError {
|
|||
Shadowing {
|
||||
original_region: Region,
|
||||
shadow: Loc<Ident>,
|
||||
kind: ShadowKind,
|
||||
},
|
||||
InvalidOptionalValue {
|
||||
field_name: Lowercase,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue