diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/TypeTranformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/TypeTranformer.kt index c40f027e144..62dd248444b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/TypeTranformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/TypeTranformer.kt @@ -33,8 +33,12 @@ private val IrTypeParameter.erasedUpperBound: IrClass? } val IrType.erasedUpperBound: IrClass? - get() = when (val classifier = classifierOrNull) { - is IrClassSymbol -> classifier.owner - is IrTypeParameterSymbol -> classifier.owner.erasedUpperBound - else -> throw IllegalStateException() - } \ No newline at end of file + get() = + if (this is IrDefinitelyNotNullType) + this.original.erasedUpperBound + else + when (val classifier = classifierOrNull) { + is IrClassSymbol -> classifier.owner + is IrTypeParameterSymbol -> classifier.owner.erasedUpperBound + else -> throw IllegalStateException() + } \ No newline at end of file