[JVM_IR] Fix incorrect name in inner class attributes.

This commit is contained in:
Mads Ager
2020-12-01 15:20:22 +01:00
committed by max-kammerer
parent fae5b8da4b
commit c776fcbd00
2 changed files with 4 additions and 14 deletions
@@ -53,6 +53,10 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas
}
private fun computeClassInternalName(irClass: IrClass): StringBuilder {
context.getLocalClassType(irClass)?.internalName?.let {
return StringBuilder(it)
}
val shortName = SpecialNames.safeIdentifier(irClass.name).identifier
when (val parent = irClass.parent) {
@@ -73,11 +77,6 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas
}
}
val localClassType = context.getLocalClassType(irClass)
if (localClassType != null) {
return StringBuilder(localClassType.internalName)
}
error(
"Local class should have its name computed in InventNamesForLocalClasses: ${irClass.fqNameWhenAvailable}\n" +
"Ensure that any lowering that transforms elements with local class info (classes, function references) " +
-9
View File
@@ -1,14 +1,5 @@
// WITH_RUNTIME
// Need to ignore dexing for now. This generates invalid inner-class attributes on the IR backend.
//
// java.lang.AssertionError: D8 dexing error: D8 dexing info: Malformed inner-class attribute:
// outerTypeInternal: C$result$1
// innerTypeInternal: C$no_name_in_PSI_3d19d79d_1ba9_4cd0_b7f5_b46aa3cd5d40$WhenMappings
// innerName: WhenMappings
//
// IGNORE_DEXING
import kotlin.coroutines.*
fun launch(block: suspend () -> String): String {