Fix concrete method inheritance in interfaces

For each non-abstract non-declared (i.e. inherited from supertypes) method in
an interface we generate its static form to the TImpl, which calls the TImpl
method from the corresponding supertype.

The accidental override tests changed because we're now trying to generate the
delegate for the super method, not knowing that it will clash with the declared
method

 #KT-2888 Fixed
 #KT-5393 Fixed
This commit is contained in:
Alexander Udalov
2014-07-25 17:41:01 +04:00
parent f81c364999
commit 4dcc373a5a
32 changed files with 441 additions and 65 deletions

View File

@@ -0,0 +1,15 @@
// If we generate equals/hashCode/toString in all interfaces, there will be too much bytecode
interface A {
fun foo(): Number = 42
}
interface B : A
class C : B {
override fun foo(): Int = super.foo() as Int
}
// 0 equals
// 0 hashCode
// 0 toString