cb9c18b7ad
#KT-2498 Fixed generateBridgeIfNeeded() now works as follows: for a given method, find which declared methods does this method override via breadth-first search. For each such declared method, generate a bridge if and only if its signature is different. Keep different methods' signatures in a set to avoid duplicated bridge signatures.
21 lines
470 B
Kotlin
21 lines
470 B
Kotlin
open enum class A<T> {
|
|
open fun foo(t: T) = "A"
|
|
}
|
|
|
|
enum class Z(val name: String) : A<String>() {
|
|
Z1 : Z("Z1")
|
|
Z2 : Z("Z2")
|
|
override fun foo(t: String) = name
|
|
}
|
|
|
|
|
|
fun box(): String {
|
|
return when {
|
|
Z.Z1.foo("") != "Z1" -> "Fail #1"
|
|
Z.Z2.foo("") != "Z2" -> "Fail #2"
|
|
(Z.Z1 : A<String>).foo("") != "Z1" -> "Fail #3"
|
|
(Z.Z2 : A<String>).foo("") != "Z2" -> "Fail #4"
|
|
else -> "OK"
|
|
}
|
|
}
|