Files
kotlin-fork/compiler/testData/diagnostics/tests/operatorsOverloading/EqualsOperatorOverrideHierarchies.kt
T
2023-01-04 08:08:32 +00:00

26 lines
789 B
Kotlin
Vendored

open class Parent {
override fun equals(other: Any?): Boolean =
super.equals(other)
}
open class OperatorParent {
override operator fun equals(other: Any?): Boolean =
super.equals(other)
}
class A : Parent() {
override fun equals(other: Any?): Boolean =
super.equals(other)
}
class B : OperatorParent() {
override fun equals(other: Any?): Boolean =
super.equals(other)
}
class C : Parent() {
override <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun equals(other: Any?): Boolean = // false positive in K1, OK in K2
super.equals(other) //
}
class D : OperatorParent() {
override <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun equals(other: Any?): Boolean = // false positive in K1, OK in K2
super.equals(other)
}