Fixed resolve of multiple inherited constructors for new-style MRO (PY-9080)

Integrated a C3 MRO algorithm implementation into PyClass.getAncestorTypes().
This commit is contained in:
Andrey Vlasovskikh
2013-04-18 18:05:03 +04:00
parent cfc8d927bc
commit f8eb0dd7f6
4 changed files with 67 additions and 43 deletions
@@ -122,17 +122,6 @@ public interface PyClass extends PsiNameIdentifierOwner, PyStatement, NameDefine
@NotNull
List<PyClassLikeType> getAncestorTypes(@NotNull TypeEvalContext context);
/**
* Return the method resolution order list for this class.
* <br/>
* see http://www.python.org/download/releases/2.3/mro/
* <br/>
* <i>Note: the list begins with this class.</i> It ends with the builtin 'object'.
* If class hierarchy is incorrect, e.g. badly looped, assertions may fail in implementation.
* @return list of classes in method resolution order for this class, at least one element long.
*/
@NotNull List<PyClass> getMRO();
/**
* Scan properties in order of definition, until processor returns true for one of them.
* @param processor to check properties