changelog upsert

This commit is contained in:
InsanusMokrassar 2021-06-23 21:29:28 +06:00
parent b420d85be5
commit 39895e58a6
2 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,8 @@
* Add functionality for multiplatform working with files: * Add functionality for multiplatform working with files:
* Main class for files `MPPFile` * Main class for files `MPPFile`
* Inline class for filenames work encapsulation `FileName` * Inline class for filenames work encapsulation `FileName`
* `FSM`
* Module inited and in preview state
## 0.5.12 ## 0.5.12

View File

@ -12,7 +12,7 @@ open class TypedSerializer<T : Any>(
) : KSerializer<T> { ) : KSerializer<T> {
protected val serializers = presetSerializers.toMutableMap() protected val serializers = presetSerializers.toMutableMap()
@InternalSerializationApi @InternalSerializationApi
override open val descriptor: SerialDescriptor = buildSerialDescriptor( open override val descriptor: SerialDescriptor = buildSerialDescriptor(
"TextSourceSerializer", "TextSourceSerializer",
SerialKind.CONTEXTUAL SerialKind.CONTEXTUAL
) { ) {
@ -21,7 +21,7 @@ open class TypedSerializer<T : Any>(
} }
@InternalSerializationApi @InternalSerializationApi
override open fun deserialize(decoder: Decoder): T { open override fun deserialize(decoder: Decoder): T {
return decoder.decodeStructure(descriptor) { return decoder.decodeStructure(descriptor) {
var type: String? = null var type: String? = null
lateinit var result: T lateinit var result: T
@ -50,7 +50,7 @@ open class TypedSerializer<T : Any>(
} }
@InternalSerializationApi @InternalSerializationApi
override open fun serialize(encoder: Encoder, value: T) { open override fun serialize(encoder: Encoder, value: T) {
encoder.encodeStructure(descriptor) { encoder.encodeStructure(descriptor) {
val valueSerializer = value::class.serializer() val valueSerializer = value::class.serializer()
val type = serializers.keys.first { serializers[it] == valueSerializer } val type = serializers.keys.first { serializers[it] == valueSerializer }