Allow .asInstanceOf[Matchable]
as this is erased to Object
#1763
Open
Description
In Scala 3 declaration of equals
is def equals(obj: Any): Boolean = ???
. This means that any attempt to match on a class instance in equals
body is met with
[error] | pattern selector should be an instance of Matchable,,
[error] | but it has unmatchable type Any instead
Official documentation suggest to fix this with obj.asInstanceOf[Matchable]
as this is guaranteed to succeed.
But this triggers DisableSyntax.noAsInstanceOf
rule for almost every custom .equals
.