U75957
06/21/2019, 10:56 AMthis::class
is available, but super::class
- not.
Need this.kralli
06/21/2019, 11:02 AMsuper
references any super type, that is the class and interfaces. It is not specific to a class, making it impossible to provide such a function. If you want to get hold of all super types, use this::class.supertypes
.kralli
06/21/2019, 11:04 AMthis::class.superclasses
if you want the classes only.marstran
06/21/2019, 11:05 AMthis::class.allSuperclasses
U75957
06/21/2019, 11:12 AMmarstran
06/21/2019, 11:18 AMmarstran
06/21/2019, 11:19 AMclass A : A1, A2, A3
. Which class object would you expect to get?U75957
06/21/2019, 11:25 AMAny
But in such example class A : A1, A2(), A3
I expect A2
this::class.supertypes
is marked as supported for JS in the documentation. But in fact compiler produce error Unsupported [This reflection API is not supported yet in JavaScript]
kralli
06/21/2019, 11:28 AMthis::class.superclasses
is marked as supported for JVM only, this::class.supertypes
however should be supportedmarstran
06/21/2019, 11:29 AMU75957
06/21/2019, 11:46 AMA2::class.js
. I just wanted to bring this duplicate code to a separate function.marstran
06/21/2019, 12:09 PMU75957
06/21/2019, 12:15 PM