JS IR: fix type checks for suspend function descendants (^KT-54382 fixed)
Consider `class A : suspend () -> Unit {}`. Type checks such as `is A`
are now performed via a regular `instanceof` check instead of the special
checks for suspend lambdas.
This commit is contained in:
committed by
Space Team
parent
bc13173ea9
commit
9342356c38
+1
-1
@@ -254,7 +254,7 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
|
||||
toType is IrDynamicType -> argument
|
||||
toType.isAny() -> generateIsObjectCheck(argument)
|
||||
toType.isNothing() -> JsIrBuilder.buildComposite(context.irBuiltIns.booleanType, listOf(argument, litFalse))
|
||||
toType.isSuspendFunctionTypeOrSubtype() -> generateSuspendFunctionCheck(argument, toType)
|
||||
toType.isSuspendFunction() -> generateSuspendFunctionCheck(argument, toType)
|
||||
isTypeOfCheckingType(toType) -> generateTypeOfCheck(argument, toType)
|
||||
// toType.isChar() -> generateCheckForChar(argument)
|
||||
toType.isNumber() -> generateNumberCheck(argument)
|
||||
|
||||
Reference in New Issue
Block a user