Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95d7ef4

Browse files
committed
close #2799.
1 parent d4e2058 commit 95d7ef4

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

+8
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,14 @@ trait Typers { self: Analyzer =>
12901290
"implementation restriction: subclassing Classfile does not\n"+
12911291
"make your annotation visible at runtime. If that is what\n"+
12921292
"you want, you must write the annotation class in Java.")
1293+
if (phase.id <= currentRun.typerPhase.id) {
1294+
for (ann <- clazz.getAnnotation(DeprecatedAttr)) {
1295+
val m = companionModuleOf(clazz, context)
1296+
if (m != NoSymbol) {
1297+
m.moduleClass.addAnnotation(AnnotationInfo(ann.atp, ann.args, List()))
1298+
}
1299+
}
1300+
}
12931301
treeCopy.ClassDef(cdef, typedMods, cdef.name, tparams1, impl2)
12941302
.setType(NoType)
12951303
}

test/files/pos/t2799.flags

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-deprecation -Xfatal-warnings

test/files/pos/t2799.scala

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@deprecated("hi mom") case class Bob ()

0 commit comments

Comments
 (0)