Fix ambiguous NullMessageChain.equals

This commit is contained in:
Him188 2020-03-08 19:48:29 +08:00
parent dad9c0b7b8
commit 86389306ee

View File

@ -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<SingleMessage> = error("accessing NullMessageChain")