summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-08-06 15:58:47 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-08-06 15:58:47 +0000
commit95d7ef40ebde72d9300bf64d4a4fc45b5a0508d7 (patch)
tree5eb308ca3dfa9c8cdbf8d5abdbd7c516fe9e4aee
parentd4e2058a3a8d49e4b130223ecaf45036f5d9096d (diff)
downloadscala-95d7ef40ebde72d9300bf64d4a4fc45b5a0508d7.tar.gz
scala-95d7ef40ebde72d9300bf64d4a4fc45b5a0508d7.tar.bz2
scala-95d7ef40ebde72d9300bf64d4a4fc45b5a0508d7.zip
close #2799.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
-rw-r--r--test/files/pos/t2799.flags1
-rw-r--r--test/files/pos/t2799.scala1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index ddbba00653..cbdbadc4bf 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1290,6 +1290,14 @@ trait Typers { self: Analyzer =>
"implementation restriction: subclassing Classfile does not\n"+
"make your annotation visible at runtime. If that is what\n"+
"you want, you must write the annotation class in Java.")
+ if (phase.id <= currentRun.typerPhase.id) {
+ for (ann <- clazz.getAnnotation(DeprecatedAttr)) {
+ val m = companionModuleOf(clazz, context)
+ if (m != NoSymbol) {
+ m.moduleClass.addAnnotation(AnnotationInfo(ann.atp, ann.args, List()))
+ }
+ }
+ }
treeCopy.ClassDef(cdef, typedMods, cdef.name, tparams1, impl2)
.setType(NoType)
}
diff --git a/test/files/pos/t2799.flags b/test/files/pos/t2799.flags
new file mode 100644
index 0000000000..d1b831ea87
--- /dev/null
+++ b/test/files/pos/t2799.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t2799.scala b/test/files/pos/t2799.scala
new file mode 100644
index 0000000000..fe93c0e301
--- /dev/null
+++ b/test/files/pos/t2799.scala
@@ -0,0 +1 @@
+@deprecated("hi mom") case class Bob ()