Skip to content

Commit

Permalink
do not embed the function to be invoke in the ast
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jan 8, 2015
1 parent 7e8c1eb commit 9e60f7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2155,12 +2155,13 @@ function inlineable_invoke(f::Function, e::Expr, atypes, sv,
return NF
end

fexpr = argexprs[1]
stmts = Any[argexprs[2]]
argexprs = argexprs[3:end]
atypes = atypes[3:end]

if isleaftype(invoke_types) && invoke_types == atypes
new_e = Expr(:call, f, argexprs...)
new_e = Expr(:call, fexpr, argexprs...)
new_e.typ = e.typ
res = inlineable_gf(f, new_e, invoke_types, sv,
enclosing_ast, argexprs)
Expand Down Expand Up @@ -2214,7 +2215,7 @@ function inlineable_invoke(f::Function, e::Expr, atypes, sv,
atypes = tuple(atypes_l...)

match_meth = _match_method(meth, atypes)
new_e = Expr(:call, f, argexprs...)
new_e = Expr(:call, fexpr, argexprs...)
new_e.typ = e.typ
if length(match_meth) == 1
match_meth = match_meth[1]::Tuple
Expand Down

0 comments on commit 9e60f7b

Please sign in to comment.