From 3a5e2fe1748d6a9a694c5601c252a9e64ecf1f77 Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Wed, 3 Feb 2021 22:11:14 +0800 Subject: [PATCH] Mark `@JvmWildcard` on Command.overloads for fix java cannot extends XXXCommand --- backend/mirai-console/src/command/Command.kt | 10 +++++----- backend/mirai-console/src/command/CompositeCommand.kt | 10 +++++----- backend/mirai-console/src/command/RawCommand.kt | 10 +++++----- backend/mirai-console/src/command/SimpleCommand.kt | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/backend/mirai-console/src/command/Command.kt b/backend/mirai-console/src/command/Command.kt index d7262efcb..143106a53 100644 --- a/backend/mirai-console/src/command/Command.kt +++ b/backend/mirai-console/src/command/Command.kt @@ -1,10 +1,10 @@ /* - * 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 AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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. * - * https://github.com/mamoe/mirai/blob/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress("NOTHING_TO_INLINE", "MemberVisibilityCanBePrivate") @@ -56,7 +56,7 @@ public interface Command { */ @ConsoleExperimentalApi("Property name is experimental") @ExperimentalCommandDescriptors - public val overloads: List + public val overloads: List<@JvmWildcard CommandSignature> /** * 用法说明, 用于发送给用户. [usage] 一般包含 [description]. diff --git a/backend/mirai-console/src/command/CompositeCommand.kt b/backend/mirai-console/src/command/CompositeCommand.kt index b3598c6f2..ccb8d73fd 100644 --- a/backend/mirai-console/src/command/CompositeCommand.kt +++ b/backend/mirai-console/src/command/CompositeCommand.kt @@ -1,10 +1,10 @@ /* - * 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 AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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. * - * https://github.com/mamoe/mirai/blob/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress( @@ -95,7 +95,7 @@ public abstract class CompositeCommand( private val reflector by lazy { CommandReflector(this, CompositeCommandSubCommandAnnotationResolver) } @ExperimentalCommandDescriptors - public final override val overloads: List by lazy { + public final override val overloads: List<@JvmWildcard CommandSignatureFromKFunction> by lazy { reflector.findSubCommands().also { reflector.validate(it) } diff --git a/backend/mirai-console/src/command/RawCommand.kt b/backend/mirai-console/src/command/RawCommand.kt index e68e34bad..850ac5612 100644 --- a/backend/mirai-console/src/command/RawCommand.kt +++ b/backend/mirai-console/src/command/RawCommand.kt @@ -1,10 +1,10 @@ /* - * 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 AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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. * - * https://github.com/mamoe/mirai/blob/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress("unused") @@ -60,7 +60,7 @@ public abstract class RawCommand( public override val permission: Permission by lazy { findOrCreateCommandPermission(parentPermission) } @ExperimentalCommandDescriptors - override val overloads: List = listOf( + override val overloads: List<@JvmWildcard CommandSignature> = listOf( CommandSignatureImpl( receiverParameter = CommandReceiverParameter(false, typeOf0()), valueParameters = listOf(AbstractCommandValueParameter.UserDefinedType.createRequired>("args", true)) diff --git a/backend/mirai-console/src/command/SimpleCommand.kt b/backend/mirai-console/src/command/SimpleCommand.kt index 46b0a2343..84ceffbc7 100644 --- a/backend/mirai-console/src/command/SimpleCommand.kt +++ b/backend/mirai-console/src/command/SimpleCommand.kt @@ -1,10 +1,10 @@ /* - * 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 AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link. + * 此源代码的使用受 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. * - * https://github.com/mamoe/mirai/blob/master/LICENSE + * https://github.com/mamoe/mirai/blob/master/LICENSE */ @file:Suppress( @@ -66,7 +66,7 @@ public abstract class SimpleCommand( private val reflector by lazy { CommandReflector(this, SimpleCommandSubCommandAnnotationResolver) } @ExperimentalCommandDescriptors - public final override val overloads: List by lazy { + public final override val overloads: List<@JvmWildcard CommandSignatureFromKFunction> by lazy { reflector.findSubCommands().also { reflector.validate(it) if (it.isEmpty())