Skip to content

Commit 4d9bc85

Browse files
committed
avoid forming Tuple{Union(), ...}, which was confusing codegen.
see comment in #11100 ideally, any Tuple containing Union() should collapse to Union(), but I will just put a bandaid on this for now.
1 parent adf2624 commit 4d9bc85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/inference.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,12 @@ function abstract_call_gf(f, fargs, argtype, e)
619619
return getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
620620
elseif istopfunction(tm, f, :next)
621621
isa(e,Expr) && (e.head = :call1)
622-
return Tuple{getfield_tfunc(fargs, argtypes[1], argtypes[2])[1], Int}
622+
t1 = getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
623+
return t1===Bottom ? Bottom : Tuple{t1, Int}
623624
elseif istopfunction(tm, f, :indexed_next)
624625
isa(e,Expr) && (e.head = :call1)
625-
return Tuple{getfield_tfunc(fargs, argtypes[1], argtypes[2])[1], Int}
626+
t1 = getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
627+
return t1===Bottom ? Bottom : Tuple{t1, Int}
626628
end
627629
end
628630
if istopfunction(tm, f, :promote_type) || istopfunction(tm, f, :typejoin)

0 commit comments

Comments
 (0)