If I call `processAllDeclaredCallables` inside of ...
# compiler
d
If I call
processAllDeclaredCallables
inside of
generateFunctions
I get a recursive loop that ends in a StackOverflowError. Is it intended that I should opt-in to
DirectDeclarationsAccess
in this case?
d
There is a
declaredScope
inside
MemberGenerationContext
passed to
generateFunctions
, you shoud use it.
Functions generated by the plugin are part of the declared scope of class, so the compiler creates a composite scope which consists of
FirClassDeclaredMemberScopeImpl
(containing declarations which were declared inside the class in the sources) and
FirGeneratedClassDeclaredMemberScope
(containing declarations generated by plugins). So this
scope.declaredScope
is the reference to the "real declared scope" with functions only from sources
👀 1
d
This works for the class in which I’m generating functions, but what if I want to find a function declaration in its superclass?
🤔 Perhaps I wouldn’t hit the recursion issue in that case
success baby 1
👌 1