Fix for Kotlin/kotlinx.serialization/136
Create a version that actually passes a type parameter in write$Self. This version should take the correct type parameters from the class rather than adding a function type parameter shared with all serializers.
This commit is contained in:
committed by
Leonid Startsev
parent
114fb5790a
commit
365a183d01
+5
-1
@@ -394,9 +394,13 @@ object KSerializerDescriptorResolver {
|
|||||||
f.source)
|
f.source)
|
||||||
)
|
)
|
||||||
|
|
||||||
val kSerialClass = thisClass.getClassFromSerializationPackage("KSerializer").toSimpleType(false)
|
val kSerialClassDesc = thisClass.getClassFromSerializationPackage("KSerializer")
|
||||||
|
|
||||||
thisClass.declaredTypeParameters.forEach {
|
thisClass.declaredTypeParameters.forEach {
|
||||||
|
val typeArgument = TypeProjectionImpl(it.defaultType)
|
||||||
|
val kSerialClass = KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, kSerialClassDesc, listOf(typeArgument))
|
||||||
|
|
||||||
|
|
||||||
args.add(ValueParameterDescriptorImpl(
|
args.add(ValueParameterDescriptorImpl(
|
||||||
f,
|
f,
|
||||||
null,
|
null,
|
||||||
|
|||||||
Reference in New Issue
Block a user