diff --git a/mirai-core-api/src/commonMain/kotlin/message/data/MessageKey.kt b/mirai-core-api/src/commonMain/kotlin/message/data/MessageKey.kt index 031b638b6..3b3990bf0 100644 --- a/mirai-core-api/src/commonMain/kotlin/message/data/MessageKey.kt +++ b/mirai-core-api/src/commonMain/kotlin/message/data/MessageKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. @@ -36,6 +36,7 @@ public interface MessageKey { * @see AbstractPolymorphicMessageKey */ public abstract class AbstractMessageKey( + @JvmField override val safeCast: (SingleMessage) -> M?, ) : MessageKey @@ -73,6 +74,7 @@ public abstract class AbstractPolymorphicMessageKey, safeCast: (SingleMessage) -> M?, ) : MessageKey, AbstractMessageKey(safeCast) { + @JvmField internal val topmostKey: MessageKey<*> = if (baseKey is AbstractPolymorphicMessageKey<*, *>) baseKey.topmostKey else baseKey }