046189087a
Implemented unqualified 'super' type resolution (in BasicExpressionTypingVisitor). No overload resolution of any kind is involved. Corresponding supertype is determined by the expected member name only: - 'super.foo(...)' - function or property (of possibly callable type) 'foo' - 'super.x' - property 'x' Supertype should provide a non-abstract implementation of such member. As a fall-back solution for diagnostics purposes, consider supertypes with abstract implementation of such member. Diagnostics: - AMBIGUOUS_SUPER on 'super', if multiple possible supertypes are available; - ABSTRACT_SUPER_CALL on selector expression, if the only available implementation is abstract. #KT-5963 Fixed
52 lines
1.0 KiB
Kotlin
Vendored
52 lines
1.0 KiB
Kotlin
Vendored
// Check that it works with inherited members
|
|
//
|
|
// DeeperBase DeeperInterface
|
|
// | |
|
|
// DeepBase DeepInterface
|
|
// \ /
|
|
// \/
|
|
// DeepDerived
|
|
//
|
|
|
|
open class DeeperBase {
|
|
open fun deeperBaseFun() {}
|
|
|
|
open val deeperBaseProp: Int
|
|
get() = 333
|
|
}
|
|
|
|
open class DeepBase : DeeperBase() {
|
|
}
|
|
|
|
interface DeeperInterface {
|
|
fun deeperInterfaceFun() {}
|
|
}
|
|
|
|
interface DeepInterface : DeeperInterface {
|
|
fun deepInterfaceFun() {}
|
|
}
|
|
|
|
class DeepDerived : DeepBase(), DeepInterface {
|
|
override fun deeperBaseFun() {}
|
|
|
|
override val deeperBaseProp: Int
|
|
get() = 444
|
|
|
|
override fun deeperInterfaceFun() {}
|
|
override fun deepInterfaceFun() {}
|
|
|
|
fun callsSuperDeeperBaseFun() {
|
|
super.deeperBaseFun()
|
|
}
|
|
|
|
fun getsSuperDeeperBaseProp(): Int =
|
|
super.deeperBaseProp
|
|
|
|
fun callsSuperInterfaceFuns() {
|
|
super.deeperInterfaceFun()
|
|
super.deepInterfaceFun()
|
|
super<DeepInterface>.deeperInterfaceFun()
|
|
super<DeepInterface>.deepInterfaceFun()
|
|
}
|
|
}
|