From a8474e6fdce4badc86daa9ff04ebac370e4533c8 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Fri, 17 Jan 2014 20:39:41 +0400 Subject: [PATCH] Return instance types for instance types of superclasses --- python/src/com/jetbrains/python/psi/impl/PyFunctionImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/psi/impl/PyFunctionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyFunctionImpl.java index 35585068c7b4..8c71346575cc 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyFunctionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyFunctionImpl.java @@ -228,7 +228,7 @@ public class PyFunctionImpl extends PyPresentableElementImpl imp if (returnClassType.getPyClass() == getContainingClass()) { final PyType receiverType = context.getType(receiver); if (receiverType instanceof PyClassType && PyTypeChecker.match(returnType, receiverType, context)) { - return receiverType; + return returnClassType.isDefinition() ? receiverType : ((PyClassType)receiverType).toInstance(); } } }