I want my equals
to compare class too and I wrote
override fun equals(other: Any?): Boolean {
return this::class == other::class && ...
}
unfortunately it swears
Expression in a class literal has a nullable type 'Any?', use !! to make the type non-nullable
But I want to compare with null
s too. What about glorious "null safety"? They forgot it for reflection? I didn't find ?::
operator or something.
Aucun commentaire:
Enregistrer un commentaire