From 6c5849707fb2e24c56bc5badc852a25ec082dbf7 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Tue, 1 Jul 2014 23:45:27 -0400 Subject: [PATCH] Ugly version of error handling 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. --- base/inference.jl | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/base/inference.jl b/base/inference.jl index 03d0e9fde58f0..af4288b0a8d71 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -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. @@ -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), @@ -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.