From a703647b790ad0d8dfc8880cd2e67522bf7eba53 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Thu, 13 Apr 2017 12:59:31 +0300 Subject: [PATCH] Type parameters for accessors should be taken from their property. --- .../konan/serialization/IrDescriptorSerializer.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/IrDescriptorSerializer.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/IrDescriptorSerializer.kt index 6088ab1058a..b0679af29cf 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/IrDescriptorSerializer.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/IrDescriptorSerializer.kt @@ -76,7 +76,11 @@ internal class IrDescriptorSerializer( proto.addValueParameter(serializeDescriptor(it)) } - descriptor.typeParameters.forEach { + val typeParameters = if (descriptor is PropertyAccessorDescriptor) + descriptor.correspondingProperty.typeParameters + else descriptor.typeParameters + + typeParameters.forEach { proto.addTypeParameter(serializeDescriptor(it)) } @@ -122,12 +126,11 @@ internal class IrDescriptorSerializer( val index = descriptorTable.indexByValue(descriptor) // For getters and setters we use - // the *protperty* original index. + // the *property* original index. val originalIndex = if (descriptor is PropertyAccessorDescriptor) { descriptorTable.indexByValue(descriptor.correspondingProperty.original) } else { descriptorTable.indexByValue(descriptor.original) - } context.log("index = $index")