correctly track argument count for inherited __init__ calls (PY-312)

This commit is contained in:
Dmitry Jemerov
2010-02-01 21:18:42 +03:00
parent 616e3e9e59
commit d4c45c7db2
@@ -114,7 +114,14 @@ public class PyCallExpressionHelper {
}
// decorators?
PyFunction method = (PyFunction)resolved; // constructor call?
if (PyNames.INIT.equals(method.getName())) implicit_offset += 1;
if (PyNames.INIT.equals(method.getName())) {
String refName = us.getCallee() instanceof PyReferenceExpression
? ((PyReferenceExpression) us.getCallee()).getReferencedName()
: null;
if (!PyNames.INIT.equals(refName)) { // PY-312
implicit_offset += 1;
}
}
// look for closest decorator
PyDecoratorList decolist = method.getDecoratorList();
if (decolist != null) {