mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Give an error instead of panicking on an empty tuple type
This commit is contained in:
parent
861f9c5d47
commit
cbd6d50584
5 changed files with 35 additions and 25 deletions
|
@ -255,6 +255,7 @@ pub enum Problem {
|
|||
StmtAfterExpr(Region),
|
||||
UnsuffixedEffectfulRecordField(Region),
|
||||
SuffixedPureRecordField(Region),
|
||||
EmptyTupleType(Region),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
@ -343,6 +344,7 @@ impl Problem {
|
|||
Problem::UnsuffixedEffectfulRecordField(_) | Problem::SuffixedPureRecordField(..) => {
|
||||
Warning
|
||||
}
|
||||
Problem::EmptyTupleType(_) => Warning,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,6 +457,7 @@ impl Problem {
|
|||
| Problem::RuntimeError(RuntimeError::ReadIngestedFileError { region, .. })
|
||||
| Problem::InvalidAliasRigid { region, .. }
|
||||
| Problem::InvalidInterpolation(region)
|
||||
| Problem::EmptyTupleType(region)
|
||||
| Problem::InvalidHexadecimal(region)
|
||||
| Problem::InvalidUnicodeCodePt(region)
|
||||
| Problem::NestedDatatype {
|
||||
|
@ -791,4 +794,5 @@ pub enum MalformedPatternProblem {
|
|||
EmptySingleQuote,
|
||||
MultipleCharsInSingleQuote,
|
||||
DuplicateListRestPattern,
|
||||
CantApplyPattern,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue