From 40bbab4b5e9e949360055c8bea07c5a1279bf45a Mon Sep 17 00:00:00 2001 From: Him188 <Him188@mamoe.net> Date: Sun, 8 Aug 2021 15:09:21 +0800 Subject: [PATCH] Use mirai `TestOnly` annotation in `ServerListImpl.<init>` --- mirai-core-utils/src/commonMain/kotlin/Annotations.kt | 4 ++-- .../src/commonMain/kotlin/network/components/ServerList.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mirai-core-utils/src/commonMain/kotlin/Annotations.kt b/mirai-core-utils/src/commonMain/kotlin/Annotations.kt index 36c83ad7c..5c1b71084 100644 --- a/mirai-core-utils/src/commonMain/kotlin/Annotations.kt +++ b/mirai-core-utils/src/commonMain/kotlin/Annotations.kt @@ -14,6 +14,6 @@ import kotlin.annotation.AnnotationTarget.* @RequiresOptIn("This can only be used in tests.", level = ERROR) -@Target(CLASS, FUNCTION, PROPERTY) -@Retention(AnnotationRetention.BINARY) +@Target(CLASS, FUNCTION, PROPERTY, CLASS, CONSTRUCTOR, FUNCTION) +@Retention(AnnotationRetention.SOURCE) public annotation class TestOnly \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/network/components/ServerList.kt b/mirai-core/src/commonMain/kotlin/network/components/ServerList.kt index 2f8791432..2570f255b 100644 --- a/mirai-core/src/commonMain/kotlin/network/components/ServerList.kt +++ b/mirai-core/src/commonMain/kotlin/network/components/ServerList.kt @@ -13,8 +13,8 @@ import kotlinx.serialization.Serializable import net.mamoe.mirai.internal.network.component.ComponentKey import net.mamoe.mirai.internal.network.components.ServerList.Companion.DEFAULT_SERVER_LIST import net.mamoe.mirai.utils.MiraiLogger +import net.mamoe.mirai.utils.TestOnly import net.mamoe.mirai.utils.info -import org.jetbrains.annotations.TestOnly import java.net.InetSocketAddress import java.util.*