diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt index e4ccbd20e5e..920117d8055 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt @@ -129,7 +129,9 @@ fun List.splitToRanges(classifier: (T) -> S): List, S>> { fun getReferenceToJsClass(type: KotlinType, context: TranslationContext): JsExpression = getReferenceToJsClass(type.constructor.declarationDescriptor, context).also { - it.kType = KTypeConstructor(context).createKType(type as SimpleType) + if (type is SimpleType) { + it.kType = KTypeConstructor(context).createKType(type) + } } fun getReferenceToJsClass(classifierDescriptor: ClassifierDescriptor?, context: TranslationContext): JsExpression {