equal_types_var requires a type index

This commit is contained in:
Ayaz Hafiz 2022-10-24 17:30:04 -05:00
parent 91eb9aaea4
commit cca5f53e98
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 93 additions and 69 deletions

View file

@ -269,12 +269,11 @@ impl Constraints {
pub fn equal_types_var(
&mut self,
var: Variable,
expected: Expected<Type>,
expected_index: ExpectedTypeIndex,
category: Category,
region: Region,
) -> Constraint {
let type_index = Self::push_type_variable(var);
let expected_index = Index::push_new(&mut self.expectations, expected.map(Cell::new));
let category_index = Self::push_category(self, category);
Constraint::Eq(Eq(type_index, expected_index, category_index, region))