mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
fix: infinite recursion bug
add `Immutable` trait (Type: !Immutable)
This commit is contained in:
parent
de92e295dc
commit
f9eb562848
26 changed files with 415 additions and 163 deletions
|
@ -302,7 +302,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
|
|||
return Ok(());
|
||||
}
|
||||
for (sub_k, sub_v) in sub.iter() {
|
||||
if let Some(sup_v) = sup.get(sub_k) {
|
||||
if let Some(sup_v) = sup.linear_get(sub_k) {
|
||||
self.sub_unify_value(sub_v, sup_v)?;
|
||||
} else {
|
||||
log!(err "{sup} does not have key {sub_k}");
|
||||
|
@ -628,7 +628,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
|
|||
(TyParam::Dict(sub), TyParam::Dict(sup)) => {
|
||||
for (sub_k, sub_v) in sub.iter() {
|
||||
if let Some(sup_v) = sup
|
||||
.get(sub_k)
|
||||
.linear_get(sub_k)
|
||||
.or_else(|| sub_tpdict_get(sup, sub_k, self.ctx))
|
||||
{
|
||||
// self.sub_unify_tp(sub_k, sup_k, _variance, loc, allow_divergence)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue