https://kotlinlang.org logo
Title
j

Jérémy Touati

08/05/2019, 5:36 AM
open class SuperClass {
    override operator fun equals(other: Any?): Boolean {
        return super.equals(other)
    }
}

class ExtendedClass : SuperClass() {
    override operator fun equals(other: Any?): Boolean {
        return super.equals(other)
    }
}
Error:(9, 14) Kotlin: 'operator' modifier is inapplicable on this function: must override ''equals()'' in Any
so apparently this doesn't compile unless I remove the
operator
keyword from `ExtendedClass`' implementation is this intended behavior? this seems... a bit weird and unintuitive to me
k

karelpeeters

08/05/2019, 7:06 AM
That's weird, I'd report this as a bug on YouTrack.
j

Jérémy Touati

08/05/2019, 8:19 AM
sure, will do, thanks
k

karelpeeters

08/05/2019, 8:20 AM
(and link it here, now I'm interested as well)
j

Jérémy Touati

08/05/2019, 8:34 AM