From 45f00b46516d97fdaec02f5ee1d6a055d0997c64 Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 11 May 2020 11:34:08 +0800 Subject: [PATCH] Fix VerifyError --- .../net.mamoe.mirai/message/data/Message.kt | 24 +++++++++---------- .../net/mamoe/mirai/message/data/Image.kt | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt index 90eb92738..7b2ba67e0 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt @@ -10,7 +10,7 @@ @file:Suppress( "MemberVisibilityCanBePrivate", "unused", "EXPERIMENTAL_API_USAGE", "NOTHING_TO_INLINE", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", - "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION" + "INAPPLICABLE_JVM_NAME" ) @file:JvmMultifileClass @file:JvmName("MessageUtils") @@ -166,7 +166,7 @@ interface Message { // must be interface. Don't consider any changes. * * @sample net.mamoe.mirai.message.data.ContentEqualsTest */ - final fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean = + /* final */ fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean = contentEqualsImpl(another, ignoreCase) /** @@ -178,7 +178,7 @@ interface Message { // must be interface. Don't consider any changes. * * @sample net.mamoe.mirai.message.data.ContentEqualsTest */ - final fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean { + /* final */ fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean { if (!this.contentToString().equals(another, ignoreCase = ignoreCase)) return false return when (this) { is SingleMessage -> true @@ -187,19 +187,19 @@ interface Message { // must be interface. Don't consider any changes. } } - final operator fun plus(another: MessageChain): MessageChain = this + another as Message - final operator fun plus(another: Message): MessageChain = this.followedBy(another) - final operator fun plus(another: SingleMessage): MessageChain = this.followedBy(another) - final operator fun plus(another: String): MessageChain = this.followedBy(another.toMessage()) - final operator fun plus(another: CharSequence): MessageChain = this.followedBy(another.toString().toMessage()) - final operator fun plus(another: Iterable): MessageChain = + /* final */ operator fun plus(another: MessageChain): MessageChain = this + another as Message + /* final */ operator fun plus(another: Message): MessageChain = this.followedBy(another) + /* final */ operator fun plus(another: SingleMessage): MessageChain = this.followedBy(another) + /* final */ operator fun plus(another: String): MessageChain = this.followedBy(another.toMessage()) + /* final */ operator fun plus(another: CharSequence): MessageChain = this.followedBy(another.toString().toMessage()) + /* final */ operator fun plus(another: Iterable): MessageChain = another.fold(this, Message::plus).asMessageChain() @JvmName("plusIterableString") - final operator fun plus(another: Iterable): MessageChain = + /* final */ operator fun plus(another: Iterable): MessageChain = another.fold(this, Message::plus).asMessageChain() - final operator fun plus(another: Sequence): MessageChain = + /* final */ operator fun plus(another: Sequence): MessageChain = another.fold(this, Message::plus).asMessageChain() } @@ -312,7 +312,7 @@ interface MessageMetadata : SingleMessage { /** * 返回空字符串 */ - final override fun contentToString(): String = "" + /* final */ override fun contentToString(): String = "" } /** diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/data/Image.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/data/Image.kt index 8dafa52ce..b92d53ceb 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/data/Image.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/data/Image.kt @@ -9,7 +9,6 @@ @file:JvmMultifileClass @file:JvmName("MessageUtils") -@file:Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") package net.mamoe.mirai.message.data @@ -78,7 +77,7 @@ actual interface Image : Message, MessageContent { @Deprecated(""" 不要自行实现 OnlineGroupImage, 它必须由协议模块实现, 否则会无法发送也无法解析. """, level = DeprecationLevel.HIDDEN) - @Suppress( "PropertyName", "unused") + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION", "PropertyName", "unused") @get:JvmSynthetic internal actual val DoNotImplementThisClass: Nothing? } \ No newline at end of file