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
29 lines
668 B
Kotlin
Vendored
29 lines
668 B
Kotlin
Vendored
// Interface AnotherInterface
|
|
// \ /
|
|
// \/
|
|
// DerivedInterface
|
|
//
|
|
|
|
interface Interface {
|
|
fun foo() {}
|
|
fun ambiguous() {}
|
|
val ambiguousProp: Int
|
|
get() = 222
|
|
}
|
|
|
|
interface AnotherInterface {
|
|
fun ambiguous() {}
|
|
val ambiguousProp: Int
|
|
get() = 333
|
|
}
|
|
|
|
interface DerivedInterface: Interface, AnotherInterface {
|
|
override fun foo() { super.foo() }
|
|
override fun ambiguous() {
|
|
<!AMBIGUOUS_SUPER!>super<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>ambiguous<!>()
|
|
}
|
|
override val ambiguousProp: Int
|
|
get() = <!AMBIGUOUS_SUPER!>super<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>ambiguousProp<!>
|
|
}
|
|
|