mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
let_import_constraint take a type index
This commit is contained in:
parent
2a4fca7034
commit
cbd014a98a
2 changed files with 13 additions and 29 deletions
|
@ -510,7 +510,7 @@ impl Constraints {
|
|||
) -> Constraint
|
||||
where
|
||||
I1: IntoIterator<Item = Variable>,
|
||||
I2: IntoIterator<Item = (Symbol, Loc<Type>)>,
|
||||
I2: IntoIterator<Item = (Symbol, Loc<TypeOrVar>)>,
|
||||
I2::IntoIter: ExactSizeIterator,
|
||||
{
|
||||
// defs and ret constraint are stored consequtively, so we only need to store one index
|
||||
|
@ -519,27 +519,10 @@ impl Constraints {
|
|||
self.constraints.push(Constraint::True);
|
||||
self.constraints.push(module_constraint);
|
||||
|
||||
let def_types = {
|
||||
let types = def_types
|
||||
.into_iter()
|
||||
.map(|(sym, Loc { region, value })| {
|
||||
let type_index = self.push_type(value);
|
||||
(
|
||||
sym,
|
||||
Loc {
|
||||
region,
|
||||
value: type_index,
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
self.def_types_slice(types)
|
||||
};
|
||||
|
||||
let let_contraint = LetConstraint {
|
||||
rigid_vars: self.variable_slice(rigid_vars),
|
||||
flex_vars: Slice::default(),
|
||||
def_types,
|
||||
def_types: self.def_types_slice(def_types),
|
||||
defs_and_ret_constraint,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue