Hi, what is this error about? `Suspicious equality...
# getting-started
u
Hi, what is this error about?
Suspicious equality check: equals() is not implemented in Object
Copy code
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) =
        oldList[oldItemPosition] == newList[newItemPosition] <----------
Type of the list items is ChatItem, which is a sealed class
Copy code
sealed class ChatItem

object ProgressBarItem : ChatItem()

data class ThreadHeaderItem(
    val commenterUsername: String,
    val commenterRealName: String?,
    val commenterImageUrl: String?,
    val commentedUsername: String,
    val commentedRealName: String?,
    val commentedTimestamp: LocalDateTime
) : ChatItem(), ThreadPart

data class AddCommentItem(val message: Message) : ChatItem(), ThreadPart
data class DateItem(val date: LocalDateTime) : ChatItem()
f
ChatItem doesn’t guarantee to have equals
you can suppress the error with
Copy code
@Suppress("DiffUtilEquals")
if you don’t care
u
ok false positive, thanks
362 Views