Hey guys, let me ask you something
I would like to put a code like this one
fun getPackage(class_: KClass<*>): String? = class_.qualifiedName?.replace(".${class_.simpleName}", "")
in my
common
module of a
multiplatform
project.
The problem is the
.qualifiedName
part doesn’t work in JavaScript and because of that I’m receiving the following error:
Unsupported [This reflection API is not supported yet in JavaScript]
It would be very nice to see JavaScript supporting the full reflection API, but, either way, the problem is a bit different.
My code is not compiling in the JavaScript module because of that.
But all of my targets other than the js could benefit from that, so, how could I avoid this error in order to make this code work for native and jvm targets and let js without that?
Where the code could live inside the
common
module?