hello, how could I create an instance of a Functio...
# reflect
i
hello, how could I create an instance of a FunctionN interface using reflection?
m
That sounds like a really strange request. This is how you can reference such function:
Copy code
fun main() {
    val f: (String) -> Unit = { s: String ->  }
    val c = f::class
    println(c)
}
However, it is not possible to create an instance this way, and it should not be. Except for the lack usefullness of such an instance, it it an interface. We create instances of classes, not interfaces. Tell me what do you need to do and we might find a solution.