summaryrefslogtreecommitdiff
path: root/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
diff options
context:
space:
mode:
Diffstat (limited to 'python/src/com/jetbrains/python/psi/types/PyFunctionType.java')
-rw-r--r--python/src/com/jetbrains/python/psi/types/PyFunctionType.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/python/src/com/jetbrains/python/psi/types/PyFunctionType.java b/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
index 4bdbae69d83d..fe3633449b74 100644
--- a/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
+++ b/python/src/com/jetbrains/python/psi/types/PyFunctionType.java
@@ -108,10 +108,14 @@ public class PyFunctionType implements PyCallableType {
*/
@Nullable
private PyClassTypeImpl selectFakeType(@Nullable PyExpression location, @NotNull TypeEvalContext context) {
- if (location instanceof PyReferenceExpression && isBoundMethodReference(((PyReferenceExpression)location), context)) {
- return PyBuiltinCache.getInstance(getCallable()).getObjectType(PyNames.FAKE_METHOD);
+ final String fakeClassName;
+ if (location instanceof PyReferenceExpression && isBoundMethodReference((PyReferenceExpression)location, context)) {
+ fakeClassName = PyNames.FAKE_METHOD;
}
- return PyBuiltinCache.getInstance(getCallable()).getObjectType(PyNames.FAKE_FUNCTION);
+ else {
+ fakeClassName = PyNames.FAKE_FUNCTION;
+ }
+ return PyBuiltinCache.getInstance(getCallable()).getObjectType(fakeClassName);
}
private boolean isBoundMethodReference(@NotNull PyReferenceExpression location, @NotNull TypeEvalContext context) {