Join Slack
Powered by
How can I obtain a reference to a generic top leve...
# announcements
s
spand
05/26/2021, 1:09 PM
How can I obtain a reference to a generic top level function? ie. something like this but working:
Copy code
fun <R> foo(block: () -> R): R = TODO() val fooName = ::foo.name
e
elizarov
05/26/2021, 1:20 PM
You cannot. That’s the side-effect of the fact that function types in Kotlin cannot have type parameters:
https://youtrack.jetbrains.com/issue/KT-34470
s
spand
05/26/2021, 2:20 PM
I see. Thanks.
5
Views
Open in Slack
Previous
Next