Tóth István Zoltán
08/31/2022, 5:09 AMclass E {
fun b1() = Unit
val b = B(this::b1)
val c = B(this::b1)
}
class B(
val func: () -> Unit
)
Results in 4 classes:
• B.class
• E.class
• E$b$1.class
• E$c$1.class
In my specific use case I have a number of compiler plugin generated functions I pass, like in the example below. I could write a workaround by generating one function that gets the instance of E and an integer index and uses a when
to select the appropriate function. But that feels like a bit forced.
class E {
fun a1() = Unit
fun a2() = Unit
init {
B(this::a1)
B(this::a2)
}
}
udalov