Fix algorithm of determining modality for fake overrides

Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed
This commit is contained in:
Alexander Udalov
2016-07-11 20:19:53 +03:00
parent 84a83e5dc2
commit b72293883d
12 changed files with 263 additions and 5 deletions
@@ -0,0 +1,18 @@
interface A {
fun foo() {}
}
interface B : A {
abstract override fun foo()
}
interface C : A {
abstract override fun foo()
}
interface D : A {
override fun foo() = super.foo()
}
// Fake override Z#foo should be open
<!MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED!>class Z<!> : B, C, D