https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
g

goncalossilva

12/09/2018, 2:13 PM
KClass::isOpen
is marked as being available in Common: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/is-open.html However, when trying to use it in a common test, it fails to compile in (at least) JS and Native. Any clues why? JS:
Unsupported [This reflection API is not supported yet in JavaScript]
Native:
error: unresolved reference: isOpen
Should this work?
j

josephivie

12/10/2018, 9:55 PM
It won’t work, unfortunately. I think support is planned for later, but for now the only thing supported is the KClass object itself existing and
isInstance
(I think that’s what it is called) If you want more reflection than that, I’m currently working on an external reflection system that will be able to give you information about that. Should be done by the end of December - uses a plugin.
👍 2
g

goncalossilva

12/11/2018, 1:50 AM
Thanks! Got it. It's a little misleading that it has the "Common" tag though... 😅
2 Views