[FIR mangler] Handle parent type aliases properly
NB: Normally parent class-like must be a class, but in expect-actual situation it may appear to be an actual type alias.
This commit is contained in:
+7
-3
@@ -79,9 +79,13 @@ open class FirJvmMangleComputer(
|
||||
else -> return
|
||||
}
|
||||
if (parentClassId != null && !parentClassId.isLocal) {
|
||||
val parentClass = session.firSymbolProvider.getClassLikeSymbolByFqName(parentClassId)?.fir as? FirRegularClass
|
||||
?: throw AssertionError("Attempt to find parent for probably-local declaration!")
|
||||
parentClass.accept(this@FirJvmMangleComputer, false)
|
||||
val parentClassLike = session.firSymbolProvider.getClassLikeSymbolByFqName(parentClassId)?.fir
|
||||
?: throw AssertionError("Attempt to find parent ($parentClassId) for probably-local declaration!")
|
||||
if (parentClassLike is FirRegularClass || parentClassLike is FirTypeAlias) {
|
||||
parentClassLike.accept(this@FirJvmMangleComputer, false)
|
||||
} else {
|
||||
throw AssertionError("Strange class-like declaration: ${parentClassLike.render()}")
|
||||
}
|
||||
} else if (parentClassId == null && !parentPackageFqName.isRoot) {
|
||||
builder.appendName(parentPackageFqName.asString())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user