diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentContext.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentContext.kt index 461fd18fa..001132087 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentContext.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentContext.kt @@ -160,7 +160,7 @@ public class SimpleCommandArgumentContext( */ @Suppress("FunctionName") @JvmSynthetic -public inline fun CommandArgumentContext(block: CommandArgumentContextBuilder.() -> Unit): CommandArgumentContext { +public fun CommandArgumentContext(block: CommandArgumentContextBuilder.() -> Unit): CommandArgumentContext { return SimpleCommandArgumentContext(CommandArgumentContextBuilder().apply(block).distinctByReversed { it.klass }) } @@ -214,8 +214,6 @@ public class CommandArgumentContextBuilder : MutableList> by mutab ): ParserPair<*> = T::class with CommandArgumentParser(parser) } - -@PublishedApi internal inline fun List.distinctByReversed(selector: (T) -> K): List { val set = HashSet() val list = ArrayList()