You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
value1 {
name = "name1",
dir = "dir1"
fileExtension = ".xlsx"
}
value2 {
name = "name2",
dir = "dir2"
fileExtension = ".xlsx"
}
value3 {
name = "name3",
dir = "dir3"
fileExtension = ".xlsx"
}
code
@Serializable
data class TestConfig(
val name: String,
val dir: String = "",
val fileExtension: String = ".xlsx",
)
@ExperimentalSerializationApi
fun main() {
val bugConfig = Files.newBufferedReader(Path.of("./bug.conf")).use(ConfigFactory::parseReader)
val bugMap = Server.hoconParser.decodeFromConfig<Map<String, TestConfig>>(bugConfig)
}
Exception
Exception in thread "main" java.util.NoSuchElementException: List is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.last(_Collections.kt:380)
at kotlinx.serialization.internal.TaggedDecoder.getCurrentTag(Tagged.kt:308)
at kotlinx.serialization.hocon.Hocon$ConfigReader.beginStructure(Hocon.kt:138)
at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:29)
at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:243)
at kotlinx.serialization.internal.TaggedDecoder.decodeSerializableValue(Tagged.kt:179)
at kotlinx.serialization.hocon.Hocon.decodeFromConfig(Hocon.kt:34)
at TestKt.main(test.kt:194)
at TestKt.main(test.kt)
Describe the bug
bug.conf
code
Exception
error in code https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/hocon/src/main/kotlin/kotlinx/serialization/hocon/Hocon.kt#L138:
Environment
The text was updated successfully, but these errors were encountered: