pattern_presence expects type index

This commit is contained in:
Ayaz Hafiz 2022-10-24 17:49:02 -05:00
parent 0990eda0cb
commit 0f0c02965a
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 32 additions and 22 deletions

View file

@ -322,14 +322,11 @@ impl Constraints {
pub fn pattern_presence(
&mut self,
typ: Type,
expected: PExpected<Type>,
type_index: TypeOrVar,
expected_index: PExpectedTypeIndex,
category: PatternCategory,
region: Region,
) -> Constraint {
let type_index = self.push_type(typ);
let expected_index =
Index::push_new(&mut self.pattern_expectations, expected.map(Cell::new));
let category_index = Index::push_new(&mut self.pattern_categories, category);
Constraint::PatternPresence(type_index, expected_index, category_index, region)