I would like to check if a class is an anonymous c...
# announcements
r
I would like to check if a class is an anonymous class at runtime. I tried the following but it failed (output is
false
)
Copy code
interface A{}
fun main(vararg args: String){
    val clazz = object: A{}::class.java
    println(clazz.isAnonymousClass)
}
Is there another possibility to check whether it is an anonymous class or not? (I do not have access to
KClass
)