From 899d471646f110b6a41a4d332e4e1521c070eb8d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 20 Feb 2020 13:43:51 +0300 Subject: [PATCH] FIR2IR: determine type parameters before class super types Type parameters can be referred from type arguments of super types, so we should determine them earlier to be able to set their indexes --- .../kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index fb783f6307a..6929977880b 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -151,12 +151,12 @@ class Fir2IrDeclarationStorage( } private fun IrClass.declareSupertypesAndTypeParameters(klass: FirClass<*>): IrClass { - superTypes = klass.superTypeRefs.map { superTypeRef -> - superTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) - } if (klass is FirRegularClass) { setTypeParameters(klass) } + superTypes = klass.superTypeRefs.map { superTypeRef -> + superTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) + } return this }