mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-24 05:26:24 +00:00
fix: type-instantiating bugs
This commit is contained in:
parent
8bb91cfe11
commit
4ff0b64fc3
8 changed files with 357 additions and 219 deletions
|
@ -968,13 +968,17 @@ impl Context {
|
|||
(_, Type::RefMut { before, .. }) => self.sub_unify(maybe_sub, before, loc, param_name),
|
||||
(_, Type::Proj { lhs, rhs }) => {
|
||||
if let Ok(evaled) = self.eval_proj(*lhs.clone(), rhs.clone(), self.level, loc) {
|
||||
self.sub_unify(maybe_sub, &evaled, loc, param_name)?;
|
||||
if maybe_sup != &evaled {
|
||||
self.sub_unify(maybe_sub, &evaled, loc, param_name)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
(Type::Proj { lhs, rhs }, _) => {
|
||||
if let Ok(evaled) = self.eval_proj(*lhs.clone(), rhs.clone(), self.level, loc) {
|
||||
self.sub_unify(&evaled, maybe_sup, loc, param_name)?;
|
||||
if maybe_sub != &evaled {
|
||||
self.sub_unify(&evaled, maybe_sup, loc, param_name)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue