bb1b8cca20
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
20 lines
304 B
Kotlin
Vendored
20 lines
304 B
Kotlin
Vendored
interface A<T> {
|
|
fun foo(): T
|
|
}
|
|
|
|
interface B<T> : A<T>
|
|
|
|
class BImpl<T>(a: A<T>) : B<T>, A<T> by a
|
|
|
|
fun box(): String {
|
|
val b: B<String> = BImpl(object : A<String> {
|
|
override fun foo() = "OK"
|
|
})
|
|
|
|
if (b.foo() != "OK") return "fail 1"
|
|
|
|
val a: A<String> = b
|
|
|
|
return a.foo()
|
|
}
|