@@ -1421,7 +1421,7 @@ function typeinf_edge(method::Method, atypes::ANY, sparams::SimpleVector, needtr
14211421 # something completely new
14221422 elseif isa (code, LambdaInfo)
14231423 # something existing
1424- if code. inferred
1424+ if code. inferred && ! (needtree && code . code === nothing )
14251425 return (code, code. rettype, true )
14261426 end
14271427 else
@@ -1457,7 +1457,7 @@ function typeinf_edge(method::Method, atypes::ANY, sparams::SimpleVector, needtr
14571457 # inference not started yet, make a new frame for a new lambda
14581458 # add lam to be inferred and record the edge
14591459
1460- if caller === nothing && needtree && in_typeinf_loop
1460+ if caller === nothing && in_typeinf_loop
14611461 # if the caller needed the ast, but we are already in the typeinf loop
14621462 # then just return early -- we can't fulfill this request
14631463 # if the client was inlining, then this means we decided not to try to infer this
@@ -1486,7 +1486,7 @@ function typeinf_edge(method::Method, atypes::ANY, sparams::SimpleVector, needtr
14861486 end
14871487 end
14881488
1489- if isa (code, LambdaInfo)
1489+ if isa (code, LambdaInfo) && code . code != = nothing
14901490 # reuse the existing code object
14911491 linfo = code
14921492 @assert typeseq (linfo. specTypes, atypes)
@@ -2412,11 +2412,10 @@ function inlineable(f::ANY, ft::ANY, e::Expr, atypes::Vector{Any}, sv::Inference
24122412 # end
24132413 # end
24142414
2415- (linfo, ty, inferred) = typeinf (method, metharg, methsp, true )
2416- if is (linfo, nothing ) || ! inferred
2415+ (linfo, ty, inferred) = typeinf (method, metharg, methsp, false )
2416+ if ! inferred || linfo === nothing
24172417 return NF
2418- end
2419- if ! linfo. inlineable
2418+ elseif ! linfo. inlineable
24202419 # TODO
24212420 #=
24222421 if incompletematch
@@ -2443,6 +2442,11 @@ function inlineable(f::ANY, ft::ANY, e::Expr, atypes::Vector{Any}, sv::Inference
24432442 end
24442443 =#
24452444 return NF
2445+ elseif linfo. code === nothing
2446+ (linfo, ty, inferred) = typeinf (method, metharg, methsp, true )
2447+ end
2448+ if linfo === nothing || ! inferred || ! linfo. inlineable
2449+ return NF
24462450 end
24472451
24482452 na = linfo. nargs
@@ -2483,7 +2487,9 @@ function inlineable(f::ANY, ft::ANY, e::Expr, atypes::Vector{Any}, sv::Inference
24832487 nm = length (methargs)
24842488
24852489 ast = linfo. code
2486- if ! isa (ast,Array{Any,1 })
2490+ if ast === nothing
2491+ return NF
2492+ elseif ! isa (ast,Array{Any,1 })
24872493 ast = ccall (:jl_uncompress_ast , Any, (Any,Any), linfo, ast)
24882494 else
24892495 ast = copy_exprargs (ast)
0 commit comments