Here is an example of an entire different approach...
# language-proposals
r
Here is an example of an entire different approach also solved with an annotation processor but in the same line of what you want to do: https://github.com/kategory/kategory/pull/448