Is there any known issue, or cases where it isn't ...
# javascript
e
Is there any known issue, or cases where it isn't supported, with
KClass.isInstance(someObject)
in K/JS? Example usage:
Copy code
getKindOfOps<InsertBeforeOp>(rewrites, InsertBeforeOp::class, i)

...

private fun <T : RewriteOperation> getKindOfOps(
  rewrites: List<RewriteOperation?>,
  kind: KClass<*>,
  before: Int,
): List<T> {
  ...
  while (i < before && i < rewrites.size) {
    ...
    if (kind.isInstance(op)) {
      @Suppress("UNCHECKED_CAST")
      ops.add(op as T)
    }
  }
  return ops
}
a
No, it should work in runtime for both classes and interfaces.
e
Perfect, thanks!