From ea5bce5683758e7dce33185a4821cb7dd57e7b78 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 27 Sep 2017 22:05:38 -0400 Subject: [PATCH] inference: remove hand-written heuristics These should now be covered by the improved recursion detector. --- base/inference.jl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/base/inference.jl b/base/inference.jl index d7e73a46698bb..67e40d9afcb2e 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -1770,15 +1770,7 @@ function abstract_call_method(method::Method, @nospecialize(f), @nospecialize(si sigtuple = unwrap_unionall(sig)::DataType tm = _topmod(sv) - if (# promote_typeof signature may be used with many arguments - !istopfunction(tm, f, :promote_typeof) - # assume getindex methods aren't directly recursive, since wrappers like ReshapedArrays won't look like it here - # should still manage to detect recursive growth either via other intermediate methods or actual type-equal signature recursion - && !istopfunction(tm, f, :getindex) - && !istopfunction(tm, f, :setindex!) - # the construct-to-convert method is a bottleneck in inference, - # so just assume that recursion will get prevented at some other point - && !(method.sig == Tuple{Type, Any})) + if (!istopfunction(tm, f, :promote_typeof)) # promote_typeof signature may be used with many arguments, here we'll just assume it is defined non-recursively # otherwise: limit argument type tuple growth of all other functions msig = unwrap_unionall(method.sig) lsig = length(msig.parameters)