raulraja
09/30/2019, 12:14 AMfun <B> bindingFilter(c: suspend MonadFilterSyntax<F>.() -> B): Kind<F, B> {
val continuation = MonadFilterContinuation<F, B>(this)
val wrapReturn: suspend MonadFilterSyntax<F>.() -> Kind<F, B> = { just(c()) }
wrapReturn.startCoroutine(continuation, continuation)
return continuation.returnedMonad()
}
In this function IR codegen freaks out with : { just(c()) }
getting into this error: https://github.com/JetBrains/kotlin/blob/9c9d2b5ad4ac27a0792d3cf4c62599fb3e09ebbb/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt#L420
Seems like IR is unable to deal with suspended lambdas like this one. While I still have work in the comprehension plugin which will get rid of this problem all together I wonder if there is a way to rewrite that so that is not a suspended lambda.simon.vergauwen
09/30/2019, 7:59 AMsuspend { just(c()) }
? Now that suspend is inferred by the lhspakoito
09/30/2019, 8:34 AM