[JS IR BE] Fix lowering types nullability
This commit is contained in:
+1
-1
@@ -426,7 +426,7 @@ private fun IrFunction.generateDefaultsFunctionImpl(
|
||||
syntheticParameters += newFunction.valueParameter(
|
||||
syntheticParameters.last().index + 1,
|
||||
"handler".synthesizedName,
|
||||
context.irBuiltIns.anyType
|
||||
context.irBuiltIns.anyNType
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.IrTypeProjection
|
||||
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
|
||||
import org.jetbrains.kotlin.ir.types.makeNullable
|
||||
import org.jetbrains.kotlin.ir.util.isInlined
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
@@ -326,7 +327,7 @@ class CallableReferenceLowering(val context: JsIrBackendContext) : FileLoweringP
|
||||
// }
|
||||
//
|
||||
val cacheName = "${factoryFunction.name}_${Namer.KCALLABLE_CACHE_SUFFIX}"
|
||||
val type = factoryFunction.returnType
|
||||
val type = factoryFunction.returnType.makeNullable()
|
||||
val irNull = { JsIrBuilder.buildNull(context.irBuiltIns.nothingNType) }
|
||||
val cacheVar = JsIrBuilder.buildVar(type, factoryFunction.parent, cacheName, true, initializer = irNull())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user