@@ -145,7 +145,7 @@ public sealed class Hocon(
145
145
146
146
}
147
147
148
- private inner class ConfigReader (val conf : Config , private val isPolymorph : Boolean = false ) : ConfigConverter<String>() {
148
+ private inner class ConfigReader (val conf : Config , private val isPolymorphic : Boolean = false ) : ConfigConverter<String>() {
149
149
private var ind = - 1
150
150
151
151
override fun decodeElementIndex (descriptor : SerialDescriptor ): Int {
@@ -162,10 +162,8 @@ public sealed class Hocon(
162
162
if (parentName.isEmpty()) childName else " $parentName .$childName "
163
163
164
164
override fun SerialDescriptor.getTag (index : Int ): String {
165
- return if (! isPolymorph) composeName(
166
- currentTagOrNull.orEmpty(),
167
- getConventionElementName(index, useConfigNamingConvention)
168
- ) else getElementName(index)
165
+ val conventionName = getConventionElementName(index, useConfigNamingConvention)
166
+ return if (! isPolymorphic) composeName(currentTagOrNull.orEmpty(), conventionName) else conventionName
169
167
}
170
168
171
169
override fun decodeNotNullMark (): Boolean {
@@ -215,8 +213,7 @@ public sealed class Hocon(
215
213
216
214
override fun beginStructure (descriptor : SerialDescriptor ): CompositeDecoder =
217
215
when {
218
- // Polymorph should always be object-like I believe?
219
- descriptor.kind.objLike -> ConfigReader (conf, isPolymorph = true )
216
+ descriptor.kind.objLike -> ConfigReader (conf, isPolymorphic = true )
220
217
else -> this
221
218
}
222
219
0 commit comments