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
17261726 if ((clazz isNonBottomSubClass ClassfileAnnotationClass ) && (clazz != ClassfileAnnotationClass )) {
17271727 if (! clazz.owner.isPackageClass)
17281728 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,
17301733 """ |subclassing Classfile does not
17311734 |make your annotation visible at runtime. If that is what
17321735 |you want, you must write the annotation class in Java.""" .stripMargin)
You can’t perform that action at this time.
0 commit comments