Type parameters for accessors should be taken from their property.

This commit is contained in:
Alexander Gorshenev
2017-04-13 12:59:31 +03:00
committed by alexander-gorshenev
parent c944ea78c1
commit a703647b79
@@ -76,7 +76,11 @@ internal class IrDescriptorSerializer(
proto.addValueParameter(serializeDescriptor(it)) 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)) proto.addTypeParameter(serializeDescriptor(it))
} }
@@ -122,12 +126,11 @@ internal class IrDescriptorSerializer(
val index = descriptorTable.indexByValue(descriptor) val index = descriptorTable.indexByValue(descriptor)
// For getters and setters we use // For getters and setters we use
// the *protperty* original index. // the *property* original index.
val originalIndex = if (descriptor is PropertyAccessorDescriptor) { val originalIndex = if (descriptor is PropertyAccessorDescriptor) {
descriptorTable.indexByValue(descriptor.correspondingProperty.original) descriptorTable.indexByValue(descriptor.correspondingProperty.original)
} else { } else {
descriptorTable.indexByValue(descriptor.original) descriptorTable.indexByValue(descriptor.original)
} }
context.log("index = $index") context.log("index = $index")