Reports recursive equals(==) calls.
In Kotlin, == compares object values by calling equals method under the hood.
===, on the other hand, compares objects by reference.
=== is commonly used in equals method implementation.
But === may be mistakenly mixed up with == leading to infinite recursion.
Example:
class X {
override fun equals(other: Any?): Boolean {
if (this == other) return true
return false
}
}
After the quick-fix is applied:
class X {
override fun equals(other: Any?): Boolean {
if (this === other) return true
return false
}
}