mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: infinite recursion bug
This commit is contained in:
parent
9f789199b9
commit
82bc710827
6 changed files with 223 additions and 7 deletions
|
@ -492,6 +492,10 @@ pub(crate) fn list_union(mut args: ValueArgs, ctx: &Context) -> EvalValueResult<
|
|||
.iter()
|
||||
.flat_map(|t| ctx.convert_value_into_type(t.clone()))
|
||||
.collect::<Vec<_>>();
|
||||
// args must already be evaluated
|
||||
if slf.iter().any(|t| t.has_proj() || t.has_proj_call()) {
|
||||
return Ok(TyParam::t(Type::Obj));
|
||||
}
|
||||
let union = slf
|
||||
.iter()
|
||||
.fold(Type::Never, |union, t| ctx.union(&union, t));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue