Open scabug opened 11 years ago
Imported From: https://issues.scala-lang.org/browse/SI-7404?orig=1 Reporter: @dragos Affected Versions: 2.10.1
@retronym said: @Iulian: Is this a regression?
@dragos said: Not as far as I know. I talked to @lrytz back then and he considered it a feature. But it would be great to find a solution and offer a better experience for IDE users.
@lrytz said (edited on May 16, 2014 12:08:03 PM UTC): I think we can just keep them. The only issues are confusion (annotations exist in two places after typing) and the memory they take. We could also do that just in the presentation compiler.
If we just don't clear remove them from the modifiers (Typer#typedModifiers), the trees will not be typed though. Is that a problem? We'd need to get the typed trees out of the AnnotationInfos otherwise, and plug them back into the modifiers.
Annotations are removed from
mods
in typer, and re-appear in corresponding symbols. However, this breaks the assumption that a (range) position can be mapped back to (a reasonable approximation of the) corresponding tree. This breaks everything in the IDE relative to annotations:The "innermost enclosing tree" for an annotation position resolves to be the enclosing
Template
.