diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 1 | ||||
-rw-r--r-- | test/files/neg/compile-time-only-a.check | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 1b6963b598..782a2880c2 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1414,6 +1414,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans private def applyRefchecksToAnnotations(tree: Tree): Unit = { def applyChecks(annots: List[AnnotationInfo]) = { + annots foreach (annot => checkCompileTimeOnly(annot.atp.typeSymbol, annot.pos)) checkAnnotations(annots map (_.atp), tree) transformTrees(annots flatMap (_.args)) } diff --git a/test/files/neg/compile-time-only-a.check b/test/files/neg/compile-time-only-a.check index 99d7a8e2dd..3a6ded7cfc 100644 --- a/test/files/neg/compile-time-only-a.check +++ b/test/files/neg/compile-time-only-a.check @@ -16,4 +16,13 @@ compile-time-only-a.scala:48: error: C6.y compile-time-only-a.scala:48: error: C6.y c6.y = c6.y ^ -6 errors found +compile-time-only-a.scala:54: error: placebo +@placebo + ^ +compile-time-only-a.scala:56: error: placebo + @placebo def x = (2: @placebo) + ^ +compile-time-only-a.scala:56: error: placebo + @placebo def x = (2: @placebo) + ^ +9 errors found |