1bbcae5ed2
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier ^KT-54890 ^KTIJ-23587 fixed
38 lines
1.2 KiB
Kotlin
Vendored
38 lines
1.2 KiB
Kotlin
Vendored
open class GenericBaseClass<T> {
|
|
open fun foo(x: T): T = x
|
|
open fun ambiguous(x: T): T = x
|
|
}
|
|
|
|
interface GenericBaseInterface<T> {
|
|
fun bar(x: T): T = x
|
|
fun ambiguous(x: T): T = x
|
|
}
|
|
|
|
class GenericDerivedClass<T> : GenericBaseClass<T>(), GenericBaseInterface<T> {
|
|
override fun foo(x: T): T = super.foo(x)
|
|
override fun bar(x: T): T = super.bar(x)
|
|
|
|
override fun ambiguous(x: T): T =
|
|
<!AMBIGUOUS_SUPER!>super<!>.ambiguous(x)
|
|
}
|
|
|
|
class SpecializedDerivedClass : GenericBaseClass<Int>(), GenericBaseInterface<String> {
|
|
override fun foo(x: Int): Int = super.foo(x)
|
|
override fun bar(x: String): String = super.bar(x)
|
|
|
|
override fun ambiguous(x: String): String =
|
|
<!AMBIGUOUS_SUPER!>super<!>.ambiguous(x)
|
|
override fun ambiguous(x: Int): Int =
|
|
<!AMBIGUOUS_SUPER!>super<!>.ambiguous(x)
|
|
}
|
|
|
|
class MixedDerivedClass<T> : GenericBaseClass<Int>(), GenericBaseInterface<T> {
|
|
override fun foo(x: Int): Int = super.foo(x)
|
|
override fun bar(x: T): T = super.bar(x)
|
|
|
|
override fun ambiguous(x: Int): Int =
|
|
<!AMBIGUOUS_SUPER!>super<!>.ambiguous(x)
|
|
override fun ambiguous(x: T): T =
|
|
<!AMBIGUOUS_SUPER!>super<!>.ambiguous(x)
|
|
}
|