mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Update PyClass so local slot overrides inherited property (PY-28206)
This commit is contained in:
@@ -793,7 +793,9 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
return property;
|
||||
}
|
||||
|
||||
if (findMethodByName(name, false, null) != null || findClassAttribute(name, false, null) != null) {
|
||||
if (findMethodByName(name, false, null) != null ||
|
||||
findClassAttribute(name, false, null) != null ||
|
||||
ContainerUtil.notNullize(getOwnSlots()).contains(name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,22 @@ public class PyPropertyAccessInspectionTest extends PyInspectionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-28206
|
||||
public void testSlotOverridesProperty() {
|
||||
doTestByText(
|
||||
"class A(object):\n" +
|
||||
" @property\n" +
|
||||
" def name(self):\n" +
|
||||
" return 'a'\n" +
|
||||
"\n" +
|
||||
"class B(A):\n" +
|
||||
" __slots__ = ('name',)\n" +
|
||||
"\n" +
|
||||
" def __init__(self, name):\n" +
|
||||
" self.name = name"
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
Reference in New Issue
Block a user