Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Mark all the generated methods with an annotation #11407
Introduce a runtime annotation inserted on all the generated methods by scalac.
It will help to distinguish user-written methods and compiler-generated methods from each other that can be useful for code analysis tools e.g. code coverage ones.
For example, jacoco uses bytecode instrumentation to analyze code coverage (so that theoretically any language that runs on top of jvm can benefit from it) and such an annotation available at runtime can be pretty useful to exclude compiler-generated methods and fields from the coverage reports.
JaCoCo is pretty flexible and can be extended to support it, but care should be taken when marking generated methods with
Here are some details
@hrhino @szhem while JaCoCo ignores all methods with attribute
IMO you can't mark generated
attempt to compile
For the reference this ticket is triggered by the following discussion started by @szhem in JaCoCo Mailing List - https://groups.google.com/d/msg/jacoco/npl9SUL8_WA/jzoprA4pAwAJ