The operation equals() defined in Any , so it should be redefined with a compatible signature: its other parameter must be of type Any? , and its return value should be Boolean or its subtype (final):
open class Texture {
Without the override modifier, your function will collide with Any::equals , therefore, a random override will occur. In addition, equals() cannot be an extension ( just like toString() ), and it cannot be overridden in an interface.
In IntelliJ IDEA, you can use Ctrl + O to override a member or Ctrl + Insert to generate equals() + hashCode()
source share