Don't process qualified targets in PyRedeclarationInspection (PY-26591)

This commit is contained in:
Semyon Proshev
2017-12-11 15:40:09 +03:00
parent 6d5be90de7
commit be28384c8a
3 changed files with 9 additions and 1 deletions
@@ -79,7 +79,7 @@ public class PyRedeclarationInspection extends PyInspection {
@Override
public void visitPyTargetExpression(final PyTargetExpression node) {
if (PyNames.UNDERSCORE.equals(node.getText())) return;
if (node.isQualified() || PyNames.UNDERSCORE.equals(node.getText())) return;
final ScopeOwner owner = ScopeUtil.getScopeOwner(node);
if (owner instanceof PyFile || owner instanceof PyClass) {
processElement(node);
@@ -0,0 +1,3 @@
a = 10
b = 10
a.b = 10
@@ -125,6 +125,11 @@ public class PyRedeclarationInspectionTest extends PyInspectionTestCase {
doTest();
}
// PY-26591
public void testQualifiedTarget() {
doTest();
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {