I want to use a higher order function as enum parameter. But this doesn't work. I have the following declaration:
enum class Enum(val someValue: Int, val someMethod: () -> Unit)
{
FIRST_VALUE(0, {method0()}),
SECOND_VALUE(1, {method1()})
fun method0() {
}
fun method1() {
}
}
But method0() and method1() cannot be found. Error is Unresolved reference: method0.
Is it somehow possible to realize this with an enum?