Return instance types for instance types of superclasses

This commit is contained in:
Andrey Vlasovskikh
2014-01-17 20:39:41 +04:00
parent 8e8019c396
commit a8474e6fdc
@@ -228,7 +228,7 @@ public class PyFunctionImpl extends PyPresentableElementImpl<PyFunctionStub> 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();
}
}
}