mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Require type and expected indices in equal_types constraints
This commit is contained in:
parent
35a4781045
commit
55d7f3f658
4 changed files with 189 additions and 104 deletions
|
@ -211,7 +211,7 @@ impl Constraints {
|
|||
EitherIndex::from_right(index)
|
||||
}
|
||||
|
||||
pub fn push_expected_type(&mut self, expected: Expected<Type>) -> Index<Expected<Cell<Type>>> {
|
||||
pub fn push_expected_type(&mut self, expected: Expected<Type>) -> ExpectedTypeIndex {
|
||||
Index::push_new(&mut self.expectations, expected.map(Cell::new))
|
||||
}
|
||||
|
||||
|
@ -256,13 +256,11 @@ impl Constraints {
|
|||
|
||||
pub fn equal_types(
|
||||
&mut self,
|
||||
typ: Type,
|
||||
expected: Expected<Type>,
|
||||
type_index: TypeOrVar,
|
||||
expected_index: ExpectedTypeIndex,
|
||||
category: Category,
|
||||
region: Region,
|
||||
) -> Constraint {
|
||||
let type_index = self.push_type(typ);
|
||||
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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue