File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1726,7 +1726,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
1726
1726
if ((clazz isNonBottomSubClass ClassfileAnnotationClass ) && (clazz != ClassfileAnnotationClass )) {
1727
1727
if (! clazz.owner.isPackageClass)
1728
1728
context.error(clazz.pos, " inner classes cannot be classfile annotations" )
1729
- else restrictionWarning(cdef.pos, unit,
1729
+ // Ignore @SerialVersionUID, because it is special-cased and handled completely differently.
1730
+ // It only extends ClassfileAnnotationClass instead of StaticAnnotation to get the enforcement
1731
+ // of constant argument values "for free". Related to SI-7041.
1732
+ else if (clazz != SerialVersionUIDAttr ) restrictionWarning(cdef.pos, unit,
1730
1733
""" |subclassing Classfile does not
1731
1734
|make your annotation visible at runtime. If that is what
1732
1735
|you want, you must write the annotation class in Java.""" .stripMargin)
You can’t perform that action at this time.
0 commit comments