KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib

This commit is contained in:
Pavel Mikhailovskii
2022-09-05 14:18:26 +02:00
committed by teamcity
parent 4d64f3a422
commit 6a14400342
13 changed files with 240 additions and 8 deletions
@@ -87,16 +87,19 @@ class ClassCodegen private constructor(
// under incremental compilation, as calls to `inline fun`s declared in this class cause them to be generated out of order.
private val innerClasses = linkedSetOf<IrClass>()
val typeMapper = object : IrTypeMapper(context) {
override fun mapType(type: IrType, mode: TypeMappingMode, sw: JvmSignatureWriter?): Type {
var t = type
while (t.isArray()) {
t = t.getArrayElementType(context.irBuiltIns)
val typeMapper =
if (context.state.oldInnerClassesLogic)
context.defaultTypeMapper
else object : IrTypeMapper(context) {
override fun mapType(type: IrType, mode: TypeMappingMode, sw: JvmSignatureWriter?): Type {
var t = type
while (t.isArray()) {
t = t.getArrayElementType(context.irBuiltIns)
}
t.classOrNull?.owner?.let(::addInnerClassInfo)
return super.mapType(type, mode, sw)
}
t.classOrNull?.owner?.let(::addInnerClassInfo)
return super.mapType(type, mode, sw)
}
}
val methodSignatureMapper = MethodSignatureMapper(context, typeMapper)