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 1e81720f0..ad6a559a3 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 @@ -393,7 +393,7 @@ inline fun MessageChain.flatten(): Sequence = this.asSequence() / /** * 不含任何元素的 [MessageChain] */ -object EmptyMessageChain : MessageChain by MessageChainImplByIterable(emptyList()) +object EmptyMessageChain : MessageChain by MessageChainImplByCollection(emptyList()) /** * Null 的 [MessageChain]. @@ -423,7 +423,7 @@ internal class MessageChainImplByIterable constructor( ) : Message, Iterable, MessageChain { override val size: Int by lazy { delegate.count() } override fun iterator(): Iterator = delegate.iterator() - var toStringTemp: String? = null + private var toStringTemp: String? = null override fun toString(): String = toStringTemp ?: this.delegate.joinToString("") { it.toString() }.also { toStringTemp = it } @@ -439,7 +439,7 @@ internal class MessageChainImplByCollection constructor( ) : Message, Iterable, MessageChain { override val size: Int get() = delegate.size override fun iterator(): Iterator = delegate.iterator() - var toStringTemp: String? = null + private var toStringTemp: String? = null override fun toString(): String = toStringTemp ?: this.delegate.joinToString("") { it.toString() }.also { toStringTemp = it } @@ -460,7 +460,7 @@ internal class MessageChainImplBySequence constructor( */ private val collected: List by lazy { delegate.toList() } override fun iterator(): Iterator = collected.iterator() - var toStringTemp: String? = null + private var toStringTemp: String? = null override fun toString(): String = toStringTemp ?: this.collected.joinToString("") { it.toString() }.also { toStringTemp = it }