This gives me JS/IR compiler `ClassCastException` ...
# javascript
r
This gives me JS/IR compiler
ClassCastException
error on 1.5.21:
Copy code
console.log(delay(5))
(it can be any suspending function inside
console.log(...)
)
Works on legacy. Also works on 1.5.10/IR with coroutines 1.5.0.
It's probably this stacktrace, but it's hard to get from logs:
Copy code
e: java.lang.ClassCastException: class org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl cannot be cast to class org.jetbrains.kotlin.ir.expressions.IrVararg (org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl and org.jetbrains.kotlin.ir.expressions.IrVararg are in unnamed module of loader 'app')
        at org.jetbrains.kotlin.ir.backend.js.lower.VarargTransformer.transformFunctionAccessExpression(VarargLowering.kt:228)
        at org.jetbrains.kotlin.ir.backend.js.lower.VarargTransformer.visitFunctionAccess(VarargLowering.kt:255)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:198)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:199)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:24)
Can someone confirm?
b
Write an inline wrapper that takes a suspend lambda and returns a promise? Looks like it working on legacy was just a bug.
Or are you logging in suspend scope already?
r
yes
b
Ah, ignore the above then 😀
r
I want to report the issue but would like someone to confirm.
b
I'll check it on my project in an hour and report back
Just checked and can confirm that I'm getting the same error with 1.5.21
Copy code
java.lang.ClassCastException: org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl incompatible with org.jetbrains.kotlin.ir.expressions.IrVararg
i
@Robert Jaros Thank you for letting us know! Will you create a ticket or should I do it?
r
I've already started to fill an issue but had to do something else 😉
a
Stumped into this again today, argh.