File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
java/kotlin-extractor/src/main/kotlin/utils Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,18 @@ fun getIrElementBinaryName(that: IrElement): String {
4444 is IrDeclarationWithName -> getName(that)
4545 else -> " (unknown-name)"
4646 }
47+
4748 val internalName = StringBuilder (shortName)
49+ if (that !is IrClass ) {
50+ val parent = that.parent
51+ if (parent is IrFile ) {
52+ // Note we'll fall through and do the IrPackageFragment case as well, since IrFile <: IrPackageFragment
53+ internalName.insert(0 , getFileClassName(parent) + " $" )
54+ }
55+ }
56+
4857 generateSequence(that.parent) { (it as ? IrDeclaration )?.parent }
4958 .forEach {
50- if (it is IrFile ) {
51- // Note we'll fall through and do the IrPackageFragment case as well, since IrFile <: IrPackageFragment
52- internalName.insert(0 , getFileClassName(it) + " $" )
53- }
5459 when (it) {
5560 is IrClass -> internalName.insert(0 , getName(it) + " $" )
5661 is IrPackageFragment -> it.fqName.asString().takeIf { fqName -> fqName.isNotEmpty() }?.let { fqName -> internalName.insert(0 , " $fqName ." ) }
You can’t perform that action at this time.
0 commit comments