If mro() is overridden in metaclass, use normal MRO + unresolved ancestor (PY-11401)
authorAndrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
Tue, 23 Dec 2014 15:05:48 +0000 (18:05 +0300)
committerAndrey Vlasovskikh <andrey.vlasovskikh@jetbrains.com>
Tue, 23 Dec 2014 15:05:48 +0000 (18:05 +0300)
commit645bd3a1b27bb3c3a45e557350fb3b81da1ab52a
tree648db6bc08393c1480381dfcb2ef74d95728829d
parent19e9c38a86c4e9bd694ee0bbcd86afc69f08af19
If mro() is overridden in metaclass, use normal MRO + unresolved ancestor (PY-11401)

We cannot evaluate the result of an overridden mro() method, so we
don't know the actual MRO chain. Let's assume that MRO is almost the
same as without this override and add an element of uncertainty by
appending a fake unresolved ancestor type to the MRO chain. Doing so
results in, for example, the unresolved references inspection ignoring
unresolved references for such a class.
python/psi-api/src/com/jetbrains/python/PyNames.java
python/src/com/jetbrains/python/psi/impl/PyClassImpl.java
python/testData/inspections/PyUnresolvedReferencesInspection/overriddenMRO.py [new file with mode: 0644]
python/testData/inspections/PyUnresolvedReferencesInspection/overriddenMROInAncestors.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java