Consider outer classes when topsorting hierarchy

- when building a topsorted hierarchy, consider not only edges to the class'
  superclasses, but also from inner/nested classes to their container. This
  effectively means that a class cannot inherit from its nested class. Similar
  cases (see the tests) are disallowed in Java.
- filter classes by their presence in TopDownAnalysisContext, not by being a
  MutableClassDescriptor (otherwise analysis for local classes ends up trying
  to do something with outer superclasses)
- delete outdated comment: topsort is needed not only for better diagnostics,
  but also for correct order of fake overrides construction
This commit is contained in:
Alexander Udalov
2014-04-02 22:51:26 +04:00
parent 9b2291d381
commit cbe6e49a93
6 changed files with 81 additions and 34 deletions
@@ -0,0 +1,6 @@
open class A : <!CYCLIC_INHERITANCE_HIERARCHY!>B.BB<!>() {
open class AA
}
open class B : <!CYCLIC_INHERITANCE_HIERARCHY!>A.AA<!>() {
open class BB
}