mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
update instantiate rigid
This commit is contained in:
parent
f2deb37a30
commit
be104d25eb
1 changed files with 7 additions and 6 deletions
|
@ -2879,19 +2879,20 @@ fn instantiate_rigids_help(subs: &mut Subs, max_rank: Rank, initial: Variable) {
|
|||
while let Some(var) = stack.pop() {
|
||||
visited.push(var);
|
||||
|
||||
let desc = subs.get_ref_mut(var);
|
||||
if desc.copy.is_some() {
|
||||
if subs.get_copy(var).is_some() {
|
||||
continue;
|
||||
}
|
||||
|
||||
desc.rank = Rank::NONE;
|
||||
desc.mark = Mark::NONE;
|
||||
desc.copy = OptVariable::from(var);
|
||||
subs.modify(var, |desc| {
|
||||
desc.rank = Rank::NONE;
|
||||
desc.mark = Mark::NONE;
|
||||
desc.copy = OptVariable::from(var);
|
||||
});
|
||||
|
||||
use Content::*;
|
||||
use FlatType::*;
|
||||
|
||||
match &desc.content {
|
||||
match subs.get_content_without_compacting(var) {
|
||||
RigidVar(name) => {
|
||||
// what it's all about: convert the rigid var into a flex var
|
||||
let name = *name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue