@Override public GroovyResolveResult[] resolveByShape() { final InferenceContext context = TypeInferenceHelper.getCurrentContext(); return context.getCachedValue( this, new Computable<GroovyResolveResult[]>() { @Override public GroovyResolveResult[] compute() { Pair<GrReferenceExpressionImpl, InferenceContext> key = Pair.create(GrReferenceExpressionImpl.this, context); GroovyResolveResult[] value = RecursionManager.doPreventingRecursion( key, true, new Computable<GroovyResolveResult[]>() { @Override public GroovyResolveResult[] compute() { return doPolyResolve(false, false); } }); return value == null ? GroovyResolveResult.EMPTY_ARRAY : value; } }); }