From 756e8b537e8326a8cae8ea9ee1862512c3b979dc Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 29 Feb 2020 13:24:24 +0800 Subject: [PATCH] Improve `equals` --- .../commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt index e082ddedb..c71fea9d9 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt @@ -300,7 +300,7 @@ internal class MemberImpl( @Suppress("DuplicatedCode") override fun equals(other: Any?): Boolean { // 不要删除. trust me if (this === other) return true - if (other !is Contact) return false + if (other !is Member) return false if (this::class != other::class) return false return this.id == other.id && this.bot == other.bot }