Hi folks. I would like to achieve the following be...
# compiler
e
Hi folks. I would like to achieve the following behaviour for the property below:
Copy code
var stringField: String?
    get() = unscoped { data: MyData ->
        data.getString()
    }
    set(value) = scoped { scope: MyScope ->
        scope.setString(value)
    }
but I'm at a loss as to how to build the lambdas received by `scoped`/`unscoped` in IR. Any hints?
n
First you create a local function with local visibility, then wrap it in a IrFunctionExpression. I suggest you make a text search for IrFunctionExpressionImpl in the kotlin source code, to see how other plugins use it.