Sponsoring work on Scala 3 macro annotations

We are working on annotation macros (as part of a Master’s project). Annotations as implemented in this project will expand after typer, and their results will not be visible for other Scala code. So macro annotations effectively can only generate code that embeds Scala in a host environment. For instance by expanding @main annotations or by generating protobuf wrappers. This is by design.

If you want typer-visible changes, you need to a preprocessor. Something like Lombok. I know this will make it difficult for many projects that are worthwhile in isolation, but the decision was taken for the greater unity of the language ecosystem, which is a very important meta property.

5 Likes