I wrote my first IR compiler plugin, which generat...
# compiler
h
I wrote my first IR compiler plugin, which generates init blocks for each annotated property. The init block throws an exception if the property does not pass some requirements. Everything works as expected! Surprisingly, the stacktrace of the thrown exception in the init block does not refer to some not existing Kotlin code line but to the annotation of the property. This is incredibly nice, but I want to understand, how I did this to keep this behaviour/use it somewhere else.
d
Stack trace locations (together with debug information) are based on
startOffset
and
endOffset
fields, which represent offsets of the element in the source file
thank you color 1