mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
report malformed int and float patterns
This commit is contained in:
parent
a05b664be0
commit
0c7a4179aa
8 changed files with 208 additions and 27 deletions
|
@ -52,6 +52,7 @@ fn headers_from_annotation_help(
|
|||
}
|
||||
Underscore
|
||||
| Shadowed(_, _)
|
||||
| MalformedPattern(_, _)
|
||||
| UnsupportedPattern(_)
|
||||
| NumLiteral(_, _)
|
||||
| IntLiteral(_)
|
||||
|
@ -117,7 +118,7 @@ pub fn constrain_pattern(
|
|||
state: &mut PatternState,
|
||||
) {
|
||||
match pattern {
|
||||
Underscore | UnsupportedPattern(_) | Shadowed(_, _) => {
|
||||
Underscore | UnsupportedPattern(_) | MalformedPattern(_, _) | Shadowed(_, _) => {
|
||||
// Neither the _ pattern nor erroneous ones add any constraints.
|
||||
}
|
||||
|
||||
|
|
|
@ -342,7 +342,7 @@ fn constrain_pattern(
|
|||
state.constraints.push(tag_con);
|
||||
}
|
||||
|
||||
Underscore | Shadowed(_, _) | UnsupportedPattern(_) => {
|
||||
Underscore | Shadowed(_, _) | MalformedPattern(_, _) | UnsupportedPattern(_) => {
|
||||
// no constraints
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue