mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
add either_type_index_to_var
This commit is contained in:
parent
59c2c05588
commit
da03b0c2b3
1 changed files with 21 additions and 0 deletions
|
@ -850,6 +850,27 @@ fn put_scratchpad(scratchpad: bumpalo::Bump) {
|
|||
});
|
||||
}
|
||||
|
||||
fn either_type_index_to_var(
|
||||
constraints: &Constraints,
|
||||
subs: &mut Subs,
|
||||
rank: Rank,
|
||||
pools: &mut Pools,
|
||||
_alias_map: &mut MutMap<Symbol, Variable>,
|
||||
either_type_index: roc_collections::soa::EitherIndex<Type, Variable>,
|
||||
) -> Variable {
|
||||
match either_type_index.split() {
|
||||
Ok(type_index) => {
|
||||
let typ = &constraints.types[type_index.index()];
|
||||
|
||||
type_to_var(subs, rank, pools, _alias_map, typ)
|
||||
}
|
||||
Err(var_index) => {
|
||||
let var = constraints.variables[var_index.index()];
|
||||
var
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn type_to_var(
|
||||
subs: &mut Subs,
|
||||
rank: Rank,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue