mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
Merge pull request #518 from erg-lang/fix_inf_rec
Fix infinite recursion bugs
This commit is contained in:
commit
b5092e7890
17 changed files with 1886 additions and 535 deletions
|
@ -348,8 +348,7 @@ pub(crate) fn __dict_getitem__(mut args: ValueArgs, ctx: &Context) -> EvalValueR
|
|||
Ok(v.into())
|
||||
} else {
|
||||
let index = if let ValueObj::Type(t) = &index {
|
||||
let derefed = ctx.coerce(t.typ().clone(), &()).unwrap_or(t.typ().clone());
|
||||
ValueObj::builtin_type(derefed)
|
||||
ValueObj::builtin_type(ctx.readable_type(t.typ().clone()))
|
||||
} else {
|
||||
index
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue