mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-13159 Fixed: "Type checker" failed to determine property type
Support abc.abstractproperty while processing class decorated properties
This commit is contained in:
committed by
Semyon Proshev
parent
392798f3c9
commit
e5b4db9357
@@ -764,7 +764,8 @@ public class PyClassImpl extends PyBaseElementImpl<PyClassStub> implements PyCla
|
||||
decoName = knownName;
|
||||
}
|
||||
}
|
||||
if (PyNames.PROPERTY.equals(decoName)) {
|
||||
if (PyNames.PROPERTY.equals(decoName) ||
|
||||
qname.equals(PyKnownDecoratorUtil.KnownDecorator.ABC_ABSTRACTPROPERTY.getQualifiedName())) {
|
||||
getter = new Maybe<>(method);
|
||||
}
|
||||
else if (useAdvancedSyntax && qname.matches(decoratorName, PyNames.GETTER)) {
|
||||
|
||||
@@ -1461,6 +1461,17 @@ public class PyTypeTest extends PyTestCase {
|
||||
"expr = float.fromhex(\"0.5\")");
|
||||
}
|
||||
|
||||
// PY-13159
|
||||
public void testAbsAbstractProperty() {
|
||||
doTest("str",
|
||||
"import abc\n" +
|
||||
"class D:\n" +
|
||||
" @abc.abstractproperty\n" +
|
||||
" def foo(self):\n" +
|
||||
" return 'foo'\n" +
|
||||
"expr = D().foo");
|
||||
}
|
||||
|
||||
// PY-20409
|
||||
public void testGetFromDictWithDefaultNoneValue() {
|
||||
doTest("Any",
|
||||
|
||||
Reference in New Issue
Block a user