Commit 5d41e78
committed
Avoid retype checking of annotations
Previously the method `typedAheadAnnotation` is never called,
which results in retyping of annotations when type checking
a class.
The problem is exhibited in the test tests/pos/t7426.scala:
class foo(x: Any) extends annotation.StaticAnnotation
@foo(new AnyRef { }) trait A
Retype checking the annotation would resulting in entering
the same symbol for the annonymous class twice.
Previously, it does not cause problem, because we use
an incorrect context for typeAhead checking the annotation,
where the symbol is incorrectly entered in the class `A`.
In the typer, a duplicate symbol is entered in the empty
package, thus there is no conflict.
Since we never check that a class member has a corresponding
tree, the bug is thus hidden.1 parent 44cb5fd commit 5d41e78
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| |||
0 commit comments