From 86389306ee69ae3248d23da8494ecd5131298169 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 8 Mar 2020 19:48:29 +0800 Subject: [PATCH] Fix ambiguous `NullMessageChain.equals` --- .../kotlin/net.mamoe.mirai/message/data/MessageChain.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt index c59e942ac..8426a0aef 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt @@ -381,7 +381,7 @@ object EmptyMessageChain : MessageChain by MessageChainImplByIterable(emptyList( */ object NullMessageChain : MessageChain { override fun toString(): String = "NullMessageChain" - override fun equals(other: Any?): Boolean = other == null + override fun equals(other: Any?): Boolean = other === this override fun contains(sub: String): Boolean = error("accessing NullMessageChain") override fun followedBy(tail: Message): CombinedMessage = CombinedMessage(left = EmptyMessageChain, element = tail) override fun iterator(): MutableIterator = error("accessing NullMessageChain")