In a compiler plugin's `IrElementTransformerVoidWi...
# compiler
o
In a compiler plugin's
IrElementTransformerVoidWithContext
, is there a way to add a file (or file-level class) to a module? Or is there another way to generate a class with a package name that is independent of those present in existing files? I'm looking for a class that could be loaded by JVM reflection via a pre-determined fully qualified name.
Insights, ideas anyone?
s
I think you can add classes to files, don't think you can add files to modules though
o
And although I’m operating at the IR level, when I add a class to a file, that always implies that the class belongs to the file’s package, right?
s
I think so, yeah The relation between packages and IR is weird, and I don't think it is easy to modify them
thank you color 1
o
Thanks for the insight! I'll raise a feature request with a use case and see what happens.
Created KT-72966 "Support creating a synthetic IR file by a backend IR compiler plugin".