scala3
scala3 copied to clipboard
Optimization: Introduce CompactAnnotation
This one takes a type argument instead of as a tree argument. This makes mapping such annotations a lot faster and also safer. In fact, in retrospect, most annotations could be represented as CompactAnnotations.
CompactAnnotation is extended by RetainingAnnotation, which is reserved for @retains, @retainsByName and @retainsCap. We make sure that all annotations with these classes are represented as RetainingAnnotations.
For now there are no CompactAnnotations other than @RetainingAnnotations but this could be changed in the future.