Skip to content

Commit

Permalink
avoid forming Tuple{Union(), ...}, which was confusing codegen.
Browse files Browse the repository at this point in the history
see comment in JuliaLang#11100

ideally, any Tuple containing Union() should collapse to Union(), but
I will just put a bandaid on this for now.
  • Loading branch information
JeffBezanson authored and tkelman committed Jun 6, 2015
1 parent ece4d16 commit 2d1dc6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,12 @@ function abstract_call_gf(f, fargs, argtype, e)
return getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
elseif istopfunction(tm, f, :next)
isa(e,Expr) && (e.head = :call1)
return Tuple{getfield_tfunc(fargs, argtypes[1], argtypes[2])[1], Int}
t1 = getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
return t1===Bottom ? Bottom : Tuple{t1, Int}
elseif istopfunction(tm, f, :indexed_next)
isa(e,Expr) && (e.head = :call1)
return Tuple{getfield_tfunc(fargs, argtypes[1], argtypes[2])[1], Int}
t1 = getfield_tfunc(fargs, argtypes[1], argtypes[2])[1]
return t1===Bottom ? Bottom : Tuple{t1, Int}
end
end
if istopfunction(tm, f, :promote_type) || istopfunction(tm, f, :typejoin)
Expand Down

0 comments on commit 2d1dc6b

Please sign in to comment.