[K/JS] Change strategy for implicitly exported declarations if there is a cycled reference
^KT-57356 Fixed
This commit is contained in:
+6
-2
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.ir.backend.js.export
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.ir.isExpect
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
@@ -556,13 +555,17 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
return this
|
||||
}
|
||||
|
||||
private val currentlyProcessedTypes = hashSetOf<IrType>()
|
||||
|
||||
private fun exportType(type: IrType, shouldCalculateExportedSupertypeForImplicit: Boolean = true): ExportedType {
|
||||
if (type is IrDynamicType)
|
||||
if (type is IrDynamicType || type in currentlyProcessedTypes)
|
||||
return ExportedType.Primitive.Any
|
||||
|
||||
if (type !is IrSimpleType)
|
||||
return ExportedType.ErrorType("NonSimpleType ${type.render()}")
|
||||
|
||||
currentlyProcessedTypes.add(type)
|
||||
|
||||
val classifier = type.classifier
|
||||
val isMarkedNullable = type.isMarkedNullable()
|
||||
val nonNullType = type.makeNotNull() as IrSimpleType
|
||||
@@ -632,6 +635,7 @@ class ExportModelGenerator(val context: JsIrBackendContext, val generateNamespac
|
||||
}
|
||||
|
||||
return exportedType.withNullability(isMarkedNullable)
|
||||
.also { currentlyProcessedTypes.remove(type) }
|
||||
}
|
||||
|
||||
private fun IrDeclarationWithName.getExportedIdentifier(): String =
|
||||
|
||||
Reference in New Issue
Block a user