IrTypes: IrClass.superTypes can depend on type parameters
IrClass.superTypes can depend on type parameters of a class and thus should be initialized after type parameters are in put in scope.
This commit is contained in:
@@ -54,6 +54,8 @@ class ClassGenerator(
|
||||
return context.symbolTable.declareClass(
|
||||
startOffset, endOffset, IrDeclarationOrigin.DEFINED, classDescriptor
|
||||
).buildWithScope { irClass ->
|
||||
declarationGenerator.generateGlobalTypeParametersDeclarations(irClass, classDescriptor.declaredTypeParameters)
|
||||
|
||||
classDescriptor.typeConstructor.supertypes.mapTo(irClass.superTypes) {
|
||||
it.toIrType()
|
||||
}
|
||||
@@ -65,8 +67,6 @@ class ClassGenerator(
|
||||
classDescriptor.thisAsReceiverParameter.type.toIrType()
|
||||
)
|
||||
|
||||
declarationGenerator.generateGlobalTypeParametersDeclarations(irClass, classDescriptor.declaredTypeParameters)
|
||||
|
||||
val irPrimaryConstructor = generatePrimaryConstructor(irClass, ktClassOrObject)
|
||||
if (irPrimaryConstructor != null) {
|
||||
generateDeclarationsForPrimaryConstructorParameters(irClass, irPrimaryConstructor, ktClassOrObject)
|
||||
|
||||
Reference in New Issue
Block a user