Implement list exhaustiveness checking

This commit is contained in:
Ayaz Hafiz 2022-11-01 10:24:48 -05:00
parent 62edf9547e
commit 17920911e4
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 524 additions and 25 deletions

View file

@ -197,7 +197,7 @@ fn index_var(
return Ok(vars);
}
FlatType::EmptyRecord => {
debug_assert!(matches!(ctor, IndexCtor::Record(&[])));
debug_assert!(matches!(ctor, IndexCtor::Record(..)));
// If there are optional record fields we don't unify them, but we need to
// cover them. Since optional fields correspond to "any" patterns, we can pass
// through arbitrary types.