Merge pull request #2917 from rtfeldman/move-exhaustiveness-checking

Moves exhaustiveness checking to type solving phase
This commit is contained in:
Richard Feldman 2022-04-25 20:55:05 -04:00 committed by GitHub
commit 6da39aa296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1067 additions and 177 deletions

View file

@ -2333,7 +2333,8 @@ impl UnionTags {
pub fn iter_all(
&self,
) -> impl Iterator<Item = (SubsIndex<TagName>, SubsIndex<VariableSubsSlice>)> {
) -> impl Iterator<Item = (SubsIndex<TagName>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
{
self.tag_names()
.into_iter()
.zip(self.variables().into_iter())
@ -2436,7 +2437,7 @@ impl<'a> UnsortedUnionTags<'a> {
}
}
pub type SortedTagsIterator<'a> = Box<dyn Iterator<Item = (TagName, &'a [Variable])> + 'a>;
pub type SortedTagsIterator<'a> = Box<dyn ExactSizeIterator<Item = (TagName, &'a [Variable])> + 'a>;
pub type SortedTagsSlicesIterator<'a> = Box<dyn Iterator<Item = (TagName, VariableSubsSlice)> + 'a>;
pub fn is_empty_tag_union(subs: &Subs, mut var: Variable) -> bool {

View file

@ -1815,6 +1815,9 @@ pub enum Category {
DefaultValue(Lowercase), // for setting optional fields
AbilityMemberSpecialization(Symbol),
Expect,
Unknown,
}
#[derive(Debug, Clone, PartialEq, Eq)]