zeugederunity
10/05/2020, 9:53 AMinline fun <reified T> T.call(block: (T)->Unit){
if (T::class == Array::class){
error("This is an array")
}
block(this)
}
I found the issue regarding that problem, but i dont know if implementing that workaround isArray
like mentioned in the issue is still the way to go. https://youtrack.jetbrains.com/issue/KT-32839
My implementation of the workaround looks like this:
// Commons
expect val KClass<*>.isArray: Boolean
// JS
actual val KClass<*>.isArray: Boolean get() = this == Array::class
// JVM
actual val KClass<*>.isArray: Boolean get() = java.isArray