Is there a utility or means to identify when AST e...
# compiler
t
Is there a utility or means to identify when AST elements that don’t exist in the source code are generated, like primary constructors or the values method on an Enum? The
origin.generated
field says generated == false, and
origin.fromSource == true
.
d
origin.generated
means that element was created by compiler plugin What you what is
source.kind
. There is a number of different fake kinds, which declares that some element correspond to some AST element, but not actually presented in here https://github.com/JetBrains/kotlin/blob/master/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt#L22
t
Thank you so much!