You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The annotations of a DefDef are added to its SymDenotation at the beginning of typedDefDef by addTypedModifiersAnnotations(ddef, sym).
The code of SymDenotation.annotations is ensureCompleted(); myAnnotations.
However, the completer for a DefDef does not trigger a call to typedDefDef. The completer types only the tpt and the rhs of the DefDef, but not the DefDef itself. Therefore, ensureCompleted() does not actually complete the annotations.
SymDenotation.annotations therefore returns either no annotations or the correct annotations, dependent only on whether a call to typedDefDef happens to have already been triggered by something else.
The text was updated successfully, but these errors were encountered:
At yesterday's Dotty meeting, it was suggested that completion of annotations (addTypedModifiersAnnotations) should be done not in typedDefDef, but at the beginning of the completer of the DefDef (and similarly for ValDef, TypeDef, and ClassDef).
Doing this introduces a cyclic reference error in tests/pos/java-interop/t1782/Test_1.scala, which contains the following code:
To complete Provider, we must complete Service. To complete Service, we now must complete its annotation. To complete the annotation of Service, we must complete Provider, hence the cycle.
The annotations of a
DefDef
are added to itsSymDenotation
at the beginning oftypedDefDef
byaddTypedModifiersAnnotations(ddef, sym)
.The code of
SymDenotation.annotations
isensureCompleted(); myAnnotations
.However, the completer for a DefDef does not trigger a call to
typedDefDef
. The completer types only thetpt
and therhs
of theDefDef
, but not theDefDef
itself. Therefore,ensureCompleted()
does not actually complete the annotations.SymDenotation.annotations
therefore returns either no annotations or the correct annotations, dependent only on whether a call totypedDefDef
happens to have already been triggered by something else.The text was updated successfully, but these errors were encountered: