From b4917ec81638963fccc83bb1853c7fbdc880a464 Mon Sep 17 00:00:00 2001 From: Anton Bannykh Date: Thu, 26 Sep 2019 17:51:38 +0300 Subject: [PATCH] JS: remove unconditional `as SimpleType` cast This is a workround for a bug introduced in the typeOf support --- .../src/org/jetbrains/kotlin/js/translate/utils/utils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {