Is it possible, from a compiler plugin, to get the...
# compiler
Is it possible, from a compiler plugin, to get the original source code for the call site of a function? Is this something being considered/possible for the new IR compiler plugins? I've been poking around in the Kotlin repository trying to figure out if an idea I have for a plugin is even possible. I found
but I'm not sure if that can be used to read the source file given an
The specific idea I have is a compiler plugin to enable power assertions similar to Groovy: There seemed to be some discussion on this a few years ago but I haven't really seen anything since:
Maybe you could use and rewrite the source code of your assert function
Woah, that’s super cool
@bnorm A little bit late to the party, but you can use
to get psi, which contains all the text with offsets.