Alexander Ioffe
02/12/2024, 4:33 PM() -> T
lambda function using IrBuilderWithScope? I'm seeing builder.irFunctionReference
but I don't know how to use that.Artem Kobzar
02/12/2024, 5:18 PMLOCAL_FUNCTION_FOR_LAMBDA
origin (ofc, fill it with types you need): https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin/blob/2c3bf967fdc81e20fc73ac90e8e54ce51833d35b/compiler/suspend-transform-plugin/src/main/kotlin/love/forte/plugin/suspendtrans/utils/IrFunctionUtils.kt#L147
• Create IrFunctionExpression IR-node, that accepts the previously created simple function and its type. As far as I know, there is no IrBuilderWithScope method for this type of IR-node, but this is how we represent lambdas inside the compiler, so you can create it with the IrFunctionExpressionImpl
constructor.Alexander Ioffe
02/12/2024, 5:32 PMAlexander Ioffe
02/12/2024, 5:41 PMtype
of the IrFunctionExpressionImpl
supposed to be? Is it the type of the whole function?Alexander Ioffe
02/12/2024, 5:49 PMcontext.symbols.suspendFunctionN
. Very nice!Artem Kobzar
02/12/2024, 6:08 PMAlexander Ioffe
02/12/2024, 9:37 PMRETURN: Incompatible return type
. Any chance you've seen that error before?Alexander Ioffe
02/12/2024, 10:08 PMcreateIrBuilder(symbol)
part is very important