move static method closer to its usage

This commit is contained in:
Dmitry Jemerov
2013-02-27 16:09:37 +01:00
parent 066ddf137d
commit c6236f1589
2 changed files with 6 additions and 6 deletions
@@ -225,7 +225,7 @@ public class PyClassTypeImpl extends UserDataHolderBase implements PyClassType {
if (isDefinition()) {
return true;
}
if (PyTypeChecker.isMethodType(this)) {
if (isMethodType(this)) {
return true;
}
final PyClass cls = getPyClass();
@@ -235,6 +235,11 @@ public class PyClassTypeImpl extends UserDataHolderBase implements PyClassType {
return false;
}
private static boolean isMethodType(@NotNull PyClassType type) {
final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(type.getPyClass());
return type.equals(builtinCache.getClassMethodType()) || type.equals(builtinCache.getStaticMethodType());
}
@Nullable
@Override
public PyType getCallType(@NotNull TypeEvalContext context, @Nullable PyQualifiedExpression callSite) {
@@ -446,11 +446,6 @@ public class PyTypeChecker {
return false;
}
public static boolean isMethodType(@NotNull PyClassType type) {
final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(type.getPyClass());
return type.equals(builtinCache.getClassMethodType()) || type.equals(builtinCache.getStaticMethodType());
}
/**
* Hack for skipping type checking for method calls of union members if there are several call alternatives.
*