fixed PY-4027 Call to constructor of super class is missed: false negative for wrong super call

This commit is contained in:
Ekaterina Tuzova
2011-06-28 20:29:18 +04:00
parent 32a1c604a0
commit 8e25d048c8
@@ -104,9 +104,15 @@ public class PyMissingConstructorInspection extends PyInspection {
if (ref != null)
callingClass = ref.resolve();
}
if (PyNames.SUPER.equals(tmp) && (PyNames.INIT.equals(callee.getName()))) {
PyExpression[] args = ((PyCallExpression)qualifier).getArguments();
if (args.length > 0) {
if (args[0].getText().equals(cl.getName()))
return true;
}
}
}
else {
tmp = qualifier.getText();
PsiReference ref = qualifier.getReference();
if (ref != null)
callingClass = ref.resolve();
@@ -118,8 +124,6 @@ public class PyMissingConstructorInspection extends PyInspection {
}
}
}
if (PyNames.SUPER.equals(tmp) && (PyNames.INIT.equals(callee.getName())))
return true;
}
}
return false;