From 8e25d048c8f72534615e3ec25eac6ed8d0e1f01e Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Tue, 28 Jun 2011 20:29:18 +0400 Subject: [PATCH] fixed PY-4027 Call to constructor of super class is missed: false negative for wrong super call --- .../inspections/PyMissingConstructorInspection.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/inspections/PyMissingConstructorInspection.java b/python/src/com/jetbrains/python/inspections/PyMissingConstructorInspection.java index 1c6702a4aec3..970e96203d37 100644 --- a/python/src/com/jetbrains/python/inspections/PyMissingConstructorInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyMissingConstructorInspection.java @@ -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;