Skip to content

Commit

Permalink
ObjectSerializer: Respect sequential decoding
Browse files Browse the repository at this point in the history
This was broken in Kotlin#1916
  • Loading branch information
Pavel Vasin committed Apr 14, 2023
1 parent 15aacd2 commit a3e6079
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -41,6 +41,9 @@ internal class ObjectSerializer<T : Any>(serialName: String, private val objectI

override fun deserialize(decoder: Decoder): T {
decoder.decodeStructure(descriptor) {
if (decodeSequentially())
return@decodeStructure

when (val index = decodeElementIndex(descriptor)) {
CompositeDecoder.DECODE_DONE -> {
return@decodeStructure
Expand Down

0 comments on commit a3e6079

Please sign in to comment.