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
This commit is contained in:
Mikhail Glukhikh
2020-02-20 13:43:51 +03:00
parent 8c21f04bf4
commit 899d471646
@@ -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
}