buildInlineLambda

fun IrPluginContext.buildInlineLambda(enclosing: IrFunction, returnType: IrType, extensionReceiverType: IrType? = null, extensionReceiverName: Name = Name.identifier($$"$this$lambda")): IrSimpleFunction(source)

Builds the inline lambda that wraps enclosing's original body (moved in via moveBody) so it can be passed to an inline helper such as span { … }, logged { … } or measure { … }.

When extensionReceiverType is provided, the lambda gains an extension receiver of that type (e.g. Span.Local.() -> T for @Traced); otherwise it is a plain () -> T.