mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: type substitution bug
This commit is contained in:
parent
9a2029d122
commit
29d270c0b3
1 changed files with 12 additions and 4 deletions
|
@ -225,8 +225,12 @@ impl<'c> Substituter<'c> {
|
|||
if st == &sup {
|
||||
return Ok(Some(child));
|
||||
} else {
|
||||
return Self::substitute_typarams(ctx, qt, &sup)
|
||||
.map(|opt_subs| opt_subs.map(|sub| sub.with_child(child)));
|
||||
return Self::substitute_typarams(ctx, qt, &sup).map(|opt_subs| {
|
||||
Some(match opt_subs {
|
||||
None => child,
|
||||
Some(sub) => sub.with_child(child),
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -305,8 +309,12 @@ impl<'c> Substituter<'c> {
|
|||
if st == &sup {
|
||||
return Ok(Some(child));
|
||||
} else {
|
||||
return Self::overwrite_typarams(ctx, qt, &sup)
|
||||
.map(|opt_subs| opt_subs.map(|sub| sub.with_child(child)));
|
||||
return Self::overwrite_typarams(ctx, qt, &sup).map(|opt_subs| {
|
||||
Some(match opt_subs {
|
||||
None => child,
|
||||
Some(sub) => sub.with_child(child),
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue