From f56e68e255517970171d57e7431359c87c586b38 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Tue, 25 Apr 2017 18:06:02 +0300 Subject: [PATCH] Make sure type arguments are serialized in the proper order. --- .../backend/konan/serialization/IrDescriptorSerializer.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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 d3ec0a6b47f..c311d65de44 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 @@ -84,6 +84,12 @@ internal class IrDescriptorSerializer( val typeParameters = descriptor.propertyIfAccessor.typeParameters typeParameters.forEach { proto.addTypeParameter(serializeDescriptor(it)) + // We explicitly serialize type parameters + // as types here so that they are interned in the + // natural order of declaration. Otherwise + // they appear in the order of appearence in the + // body of the function, and get wrong indices. + typeSerializer(it.defaultType) } descriptor.valueParameters.forEach {