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
What should be the effective annotation of the type of x? @a, @b, or both?
The first thing that Type.hasAnnotation(ClassSymbol) does is call stripTypeVar, so that loses @b. The current implementation of stripTypeVar throws away all annotations (so that it can find a typevar inside an AnnotatedType), so that loses @a as well. This implementation is clearly wrong (hasAnnotation ends up always returning false for every type), but what is the right (expected) behaviour? Should a typevar just accumulate all of the annotations of the types that it is instantiated with (@a @b in this example)?
The text was updated successfully, but these errors were encountered:
Consider the following code:
What should be the effective annotation of the type of
x
?@a
,@b
, or both?The first thing that
Type.hasAnnotation(ClassSymbol)
does is callstripTypeVar
, so that loses@b
. The current implementation ofstripTypeVar
throws away all annotations (so that it can find a typevar inside anAnnotatedType
), so that loses@a
as well. This implementation is clearly wrong (hasAnnotation
ends up always returning false for every type), but what is the right (expected) behaviour? Should a typevar just accumulate all of the annotations of the types that it is instantiated with (@a @b
in this example)?The text was updated successfully, but these errors were encountered: