How can I get the nested classes inside a `KSClass...
# ksp
j
How can I get the nested classes inside a
KSClassDeclaration
? In my case I have
Copy code
@MyAnnotation
interface MyInterface {
    class SomeNestedClass
}
j
you should be able to get it in the
declarations
of your annotated class.
j
I’ll try, since there are
getAllProperties
and
getFunctions
I was expecting a
getNestedClasses
or something like that maybe
j
The reason for
getAll*
APIs is for inherited members visible in the current class, the purpose is quite different from get nested classes, to get all with inherited members, one need to go through all super types and check visibility, which is non trivia therefore we provided APIs, to get nested classes, it is trivia to simply do a filtering on the current class, so it is not provided.\
👍 1