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:
Paul de Vrieze
2018-05-25 13:34:37 +01:00
committed by Leonid Startsev
parent 114fb5790a
commit 365a183d01
@@ -394,9 +394,13 @@ object KSerializerDescriptorResolver {
f.source)
)
val kSerialClass = thisClass.getClassFromSerializationPackage("KSerializer").toSimpleType(false)
val kSerialClassDesc = thisClass.getClassFromSerializationPackage("KSerializer")
thisClass.declaredTypeParameters.forEach {
val typeArgument = TypeProjectionImpl(it.defaultType)
val kSerialClass = KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, kSerialClassDesc, listOf(typeArgument))
args.add(ValueParameterDescriptorImpl(
f,
null,