From ee405b15caf1f6cf6fa1ddc613611d84665dd2f9 Mon Sep 17 00:00:00 2001 From: Anton Bragin Date: Thu, 28 Dec 2017 11:11:15 +0300 Subject: [PATCH] PY-4813 Performance tests fix --- .../python/codeInsight/typing/PyTypingTypeProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java b/python/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java index ad93e62f7f2c..05594af5381a 100644 --- a/python/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java +++ b/python/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java @@ -282,7 +282,10 @@ public class PyTypingTypeProvider extends PyTypeProviderBase { private static PyFunctionType getOverriddenFunctionType(@NotNull PyFunction function, @NotNull TypeEvalContext context) { final PyFunction overriddenFunction = getOverriddenFunction(function, context); if (overriddenFunction != null) { - return (PyFunctionType)context.getType(overriddenFunction); + PyType type = context.getType(overriddenFunction); + if (type instanceof PyFunctionType) { + return (PyFunctionType)context.getType(overriddenFunction); + } } return null;