58 lines
930 B
Kotlin
Vendored
58 lines
930 B
Kotlin
Vendored
// Base Interface
|
|
// \ /
|
|
// \/
|
|
// Derived
|
|
//
|
|
|
|
open class Base() {
|
|
open fun foo() {}
|
|
|
|
open fun ambiguous() {}
|
|
|
|
open val prop: Int
|
|
get() = 1234
|
|
|
|
open val ambiguousProp: Int
|
|
get() = 111
|
|
}
|
|
|
|
interface Interface {
|
|
fun bar() {}
|
|
|
|
fun ambiguous() {}
|
|
|
|
val ambiguousProp: Int
|
|
get() = 222
|
|
}
|
|
|
|
class Derived : Base(), Interface {
|
|
override fun foo() {}
|
|
override fun bar() {}
|
|
|
|
override fun ambiguous() {}
|
|
|
|
override val ambiguousProp: Int
|
|
get() = 333
|
|
|
|
override val prop: Int
|
|
get() = 4321
|
|
|
|
fun callsFunFromSuperClass() {
|
|
super.foo()
|
|
}
|
|
|
|
fun getSuperProp(): Int =
|
|
super.prop
|
|
|
|
fun getAmbiguousSuperProp(): Int =
|
|
super.<!AMBIGUITY!>ambiguousProp<!>
|
|
|
|
fun callsFunFromSuperInterface() {
|
|
super.bar()
|
|
}
|
|
|
|
fun callsAmbiguousSuperFun() {
|
|
super.<!AMBIGUITY!>ambiguous<!>()
|
|
}
|
|
}
|