[JS IR] Erase IrErrorType into IrErrorType

This commit is contained in:
Roman Artemev
2021-12-08 14:47:08 +03:00
committed by TeamCityServer
parent 002d6723ac
commit dc1155de24
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.ir.util.defaultType
fun IrType.eraseGenerics(irBuiltIns: IrBuiltIns): IrType {
if (this is IrDynamicType) return this
if (this is IrErrorType) return this
val defaultType = this.erasedUpperBound?.defaultType ?: irBuiltIns.anyType
if (!this.isNullable()) return defaultType
return defaultType.makeNullable()