Fix can panic with unbound type variables

This commit is contained in:
Joshua Warner 2024-12-25 12:01:56 -05:00
parent 9b13b19d08
commit f4698e1517
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
4 changed files with 39 additions and 7 deletions

View file

@ -256,6 +256,7 @@ pub enum Problem {
UnsuffixedEffectfulRecordField(Region),
SuffixedPureRecordField(Region),
EmptyTupleType(Region),
UnboundTypeVarsInAs(Region),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -345,6 +346,7 @@ impl Problem {
Warning
}
Problem::EmptyTupleType(_) => Warning,
Problem::UnboundTypeVarsInAs(_) => Warning,
}
}
@ -511,6 +513,7 @@ impl Problem {
| Problem::ReturnOutsideOfFunction { region, .. }
| Problem::StatementsAfterReturn { region }
| Problem::ReturnAtEndOfFunction { region }
| Problem::UnboundTypeVarsInAs(region)
| Problem::UnsuffixedEffectfulRecordField(region)
| Problem::SuffixedPureRecordField(region) => Some(*region),
Problem::RuntimeError(RuntimeError::CircularDef(cycle_entries))