mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Give DynamicReferenceValue a public constructor for custom extending
This commit is contained in:
parent
912b2e3464
commit
4bbf6549a7
@ -264,7 +264,7 @@ sealed class Value<T : Any> : ReadWriteProperty<Setting, T> {
|
|||||||
* 只引用这个对象, 而不跟踪其成员.
|
* 只引用这个对象, 而不跟踪其成员.
|
||||||
* 仅适用于基础类型, 用于 mutable list/map 等情况; 或标注了 [Serializable] 的类.
|
* 仅适用于基础类型, 用于 mutable list/map 等情况; 或标注了 [Serializable] 的类.
|
||||||
*/
|
*/
|
||||||
abstract class DynamicReferenceValue<T : Any> internal constructor() : Value<T>()
|
abstract class DynamicReferenceValue<T : Any> : Value<T>()
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -59,6 +59,9 @@ abstract class Setting : SettingImpl() {
|
|||||||
override fun toString(): String = yamlForToString.stringify(this.serializer, this)
|
override fun toString(): String = yamlForToString.stringify(this.serializer, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于更新或保存这个 [Value] 的序列化器.
|
||||||
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val <T : Setting> T.serializer: KSerializer<T>
|
val <T : Setting> T.serializer: KSerializer<T>
|
||||||
get() = kotlinSerializer as KSerializer<T>
|
get() = kotlinSerializer as KSerializer<T>
|
||||||
|
Loading…
Reference in New Issue
Block a user