This commit is contained in:
Luke Boswell 2024-11-11 10:22:58 +11:00
parent 743030fc99
commit 8a566dc339
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
260 changed files with 6344 additions and 2958 deletions

View file

@ -251,6 +251,7 @@ pub enum Problem {
ReturnAtEndOfFunction {
region: Region,
},
StmtAfterExpr(Region),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -335,6 +336,7 @@ impl Problem {
Problem::ReturnOutsideOfFunction { .. } => Warning,
Problem::StatementsAfterReturn { .. } => Warning,
Problem::ReturnAtEndOfFunction { .. } => Warning,
Problem::StmtAfterExpr(_) => Fatal,
}
}
@ -480,8 +482,8 @@ impl Problem {
}
| Problem::NotAnAbility(region)
| Problem::ImplementsNonRequired { region, .. }
| Problem::DoesNotImplementAbility { region, .. }
| Problem::NoIdentifiersIntroduced(region)
| Problem::DoesNotImplementAbility { region, .. }
| Problem::OverloadedSpecialization {
overload: region, ..
}
@ -505,6 +507,7 @@ impl Problem {
| Problem::BadRecursion(cycle_entries) => {
cycle_entries.first().map(|entry| entry.expr_region)
}
Problem::StmtAfterExpr(region) => Some(*region),
Problem::RuntimeError(RuntimeError::UnresolvedTypeVar)
| Problem::RuntimeError(RuntimeError::ErroneousType)
| Problem::RuntimeError(RuntimeError::NonExhaustivePattern)