From 61f70e48cecddf27fba162c165dfaf712c84278c Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 14 Jan 2013 14:30:57 -0800 Subject: SI-6375, warn on lost annotation. Annotations on abstract vals which are not meta-annotated were silently discarded. Still discarded, only less silently. I warned on as many "lost annotation" situations as I was reasonably able to cover without false positives. --- test/files/neg/t6375.check | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/files/neg/t6375.check (limited to 'test/files/neg/t6375.check') diff --git a/test/files/neg/t6375.check b/test/files/neg/t6375.check new file mode 100644 index 0000000000..b94a067cbb --- /dev/null +++ b/test/files/neg/t6375.check @@ -0,0 +1,27 @@ +t6375.scala:6: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @getter) + @Bippy val x1: Int // warn + ^ +t6375.scala:7: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.field @getter) + @(Bippy @field) val x2: Int // warn + ^ +t6375.scala:9: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.setter @getter) + @(Bippy @setter) val x4: Int // warn + ^ +t6375.scala:10: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.param @getter) + @(Bippy @param) val x5: Int // warn + ^ +t6375.scala:20: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.getter @field) + @(Bippy @getter) private[this] val q1: Int = 1 // warn + ^ +t6375.scala:40: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.getter @param) + @(Bippy @getter) p2: Int, // warn + ^ +t6375.scala:41: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.setter @param) + @(Bippy @setter) p3: Int, // warn + ^ +t6375.scala:42: warning: Annotation is unused - it can be retained with a meta-annotation such as @(Bippy @scala.annotation.meta.field @param) + @(Bippy @field) p4: Int // warn + ^ +error: No warnings can be incurred under -Xfatal-warnings. +8 warnings found +one error found -- cgit v1.2.3