scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Optimization: Introduce CompactAnnotation

Open odersky opened this issue 1 week ago • 3 comments

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.

odersky avatar Dec 05 '25 18:12 odersky