Skip to content

Commit

Permalink
Ugly version of error handling
Browse files Browse the repository at this point in the history
This will have to be changed once we switch the way we do func_for_method,
but I will await @JeffBezanson's judgement on how to do that best, so I'll
use this to go head first.
  • Loading branch information
Keno committed Aug 13, 2014
1 parent 251f0c4 commit 6c58497
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,13 @@ function abstract_call_gf(f, fargs, argtypes, e)
end
end
for (m::Tuple) in x
linfo = func_for_method(m[3],argtypes)
local linfo
try
linfo = func_for_method(m[3],argtypes)
catch
rettype = Any
break
end
sig = m[1]
lsig = length(m[3].sig)
# limit argument type tuple based on size of definition signature.
Expand Down Expand Up @@ -755,7 +761,12 @@ function invoke_tfunc(f, types, argtypes)
return Any
end
for (m::Tuple) in applicable
linfo = func_for_method(m[3],types)
local linfo
try
linfo = func_for_method(m[3],types)
catch
return Any
end
if typeseq(m[1],types)
tvars = m[2][1:2:end]
(ti, env) = ccall(:jl_match_method, Any, (Any,Any,Any),
Expand Down Expand Up @@ -2079,7 +2090,12 @@ function inlineable(f, e::Expr, atypes, sv, enclosing_ast)
end
meth = meth[1]::Tuple

linfo = func_for_method(meth[3],atypes)
local linfo
try
linfo = func_for_method(meth[3],atypes)
catch
return NF
end

## This code tries to limit the argument list length only when it is
## growing due to recursion.
Expand Down

0 comments on commit 6c58497

Please sign in to comment.