Skip to content

Commit

Permalink
do not throw error during typeinf if method matching failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jan 8, 2015
1 parent 9cab9ee commit fff4f2b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ function invoke_tfunc(f, types, argtypes)
end
(ti, env) = ccall(:jl_match_method, Any, (Any, Any, Any),
argtypes, meth.sig, meth.tvars)::(Any, Any)
if !isa(ti, Tuple)
return Any
end
local linfo
try
linfo = func_for_method(meth, types, env)
Expand Down Expand Up @@ -2232,9 +2235,11 @@ _match_method(m::ANY, t::ANY) = _match_method(m, Any[(t::Tuple)...],
length(t::Tuple), [])
function _match_method(m::ANY, t::Array, i, matching::Array{Any, 1})
if i == 0
res = ccall(:jl_match_method, Any, (Any, Any, Any),
tuple(t...), m.sig, m.tvars)::(Any, Any)
push!(matching, tuple(res..., m))
(ti, env) = ccall(:jl_match_method, Any, (Any, Any, Any),
tuple(t...), m.sig, m.tvars)::(Any, Any)
if isa(ti, Tuple)
push!(matching, tuple(ti, env, m))
end
else
ti = t[i]
if isa(ti, UnionType)
Expand Down

0 comments on commit fff4f2b

Please sign in to comment.