Generate with @JvmStatic

This commit is contained in:
Him188 2020-06-23 22:31:45 +08:00
parent 7b359108b9
commit 77db778503
2 changed files with 25 additions and 4 deletions

View File

@ -17,10 +17,13 @@ object _Setting_value_ktCodegen {
override val defaultInvokeArgs: List<KtType> = KtPrimitives + KtString
override fun StringBuilder.apply(ktType: KtType) {
appendKCode(
"""
appendLine(
kCode(
"""
@JvmStatic
val ${ktType.standardName}SerializerDescriptor = ${ktType.standardName}.serializer().descriptor
"""
).lines().joinToString("\n") { " $it" }
)
}
}

View File

@ -16,19 +16,37 @@ import net.mamoe.mirai.console.setting.Setting
internal object BuiltInSerializerConstants {
//// region BuiltInSerializerConstants primitives CODEGEN ////
//// region BuiltInSerializerConstants primitives CODEGEN ////
@JvmStatic
val ByteSerializerDescriptor = Byte.serializer().descriptor
@JvmStatic
val ShortSerializerDescriptor = Short.serializer().descriptor
@JvmStatic
val IntSerializerDescriptor = Int.serializer().descriptor
@JvmStatic
val LongSerializerDescriptor = Long.serializer().descriptor
@JvmStatic
val FloatSerializerDescriptor = Float.serializer().descriptor
@JvmStatic
val DoubleSerializerDescriptor = Double.serializer().descriptor
@JvmStatic
val CharSerializerDescriptor = Char.serializer().descriptor
@JvmStatic
val BooleanSerializerDescriptor = Boolean.serializer().descriptor
@JvmStatic
val StringSerializerDescriptor = String.serializer().descriptor
//// endregion BuiltInSerializerConstants primitives CODEGEN ////
//// endregion BuiltInSerializerConstants primitives CODEGEN ////
}
//// region Setting.value primitives impl CODEGEN ////