Fix AssertionError in CodegenUtil.getDelegates

Change getAllOverriddenDescriptors contracti, now it returns
original (not substituted) descriptors without any duplicates.

First of all it's necessary in CodegenUtil.getDelegates to avoid
duplicates (see assertion there), but also it's convenient for all
other usages of this method

 #KT-8154 Fixed
This commit is contained in:
Denis Zharkov
2016-09-27 17:34:50 +03:00
parent 49fee026fc
commit bb1b8cca20
9 changed files with 74 additions and 5 deletions
@@ -0,0 +1,11 @@
interface A<T> {
fun foo()
}
interface B<T> : A<T> {
fun bar()
}
class BImpl<T>(a: A<T>) : B<T>, A<T> by a {
override fun bar() { throw UnsupportedOperationException() }
}
@@ -0,0 +1,25 @@
package
public interface A</*0*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B</*0*/ T> : A<T> {
public abstract fun bar(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class BImpl</*0*/ T> : B<T>, A<T> {
public constructor BImpl</*0*/ T>(/*0*/ a: A<T>)
public open override /*1*/ fun bar(): kotlin.Unit
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*2*/ /*delegation*/ fun foo(): kotlin.Unit
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
}