Q: At the moment, user-defined types cannot extend...
# javascript
n
Q: At the moment, user-defined types cannot extend function types when compiling to the JS platform. Are there plans to remove that limitation?
b
At least we are going to investigate such a possibility for the new JS backend.
n
That would be great. I’ve got a bunch of libraries I’d like to make multiplatform, and this is one of the main hurdles
b
Feel free to vote or subscribe to the issue https://youtrack.jetbrains.com/issue/KT-29580. And please share more info about your usecases?
Maybe we could help you to workaround your issues?
n
I’ve developed the libraries for the JVM. Porting to JS is not possible without changing the API.
j
An interesting note: The reflection APIs themselves require the ability to extend function types, so if the Kotlin team ever intends for there to be reflection for JS, either you will get your wish or the reflection API will change.
b
I think reflection is not main case for this issue, we can support it for our stdlib and reflection and, actually, we do it.
BTW, Kotlin/JS supports some small subset of reflection API