[JS IC] fix cross-module nested class references and interface inheritance
^ KT-50528 fixed
This commit is contained in:
@@ -99,7 +99,7 @@ fun compileWithIC(
|
||||
module.files.filter { it.fileEntry.name in dirties }
|
||||
} ?: module.files
|
||||
|
||||
val ast = transformer.generateBinaryAst(dirtyFiles)
|
||||
val ast = transformer.generateBinaryAst(dirtyFiles, allModules)
|
||||
|
||||
ast.entries.forEach { (path, bytes) -> cacheConsumer.commitBinaryAst(path, bytes) }
|
||||
}
|
||||
|
||||
+6
-2
@@ -104,14 +104,18 @@ class IrModuleToJsTransformerTmp(
|
||||
return CompilerResult(result, dts)
|
||||
}
|
||||
|
||||
fun generateBinaryAst(files: Iterable<IrFile>): Map<String, ByteArray> {
|
||||
fun generateBinaryAst(files: Iterable<IrFile>, allModules: Iterable<IrModuleFragment>): Map<String, ByteArray> {
|
||||
val exportModelGenerator = ExportModelGenerator(backendContext, generateNamespacesForPackages = true)
|
||||
|
||||
val exportData = files.associate { file ->
|
||||
file to exportModelGenerator.generateExportWithExternals(file)
|
||||
}
|
||||
|
||||
files.forEach { StaticMembersLowering(backendContext).lower(it) }
|
||||
allModules.forEach {
|
||||
it.files.forEach {
|
||||
StaticMembersLowering(backendContext).lower(it)
|
||||
}
|
||||
}
|
||||
|
||||
val serializer = JsIrAstSerializer()
|
||||
|
||||
|
||||
+1
-1
@@ -301,7 +301,7 @@ class JsClassGenerator(private val irClass: IrClass, val context: JsGenerationCo
|
||||
?.let {
|
||||
val implClassDeclaration = it.parent as IrClass
|
||||
|
||||
if (implClassDeclaration.shouldCopyFrom() && it.body != null) {
|
||||
if (implClassDeclaration.shouldCopyFrom()) {
|
||||
val reference = context.getNameForStaticDeclaration(it).makeRef()
|
||||
classModel.postDeclarationBlock.statements += jsAssignment(memberRef, reference).makeStmt()
|
||||
if (isFakeOverride) {
|
||||
|
||||
Reference in New Issue
Block a user