From 39352fe0f3048e86b339db4b40851a9f27c7a6ef Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 13 Jan 2013 14:28:33 +0100 Subject: SI-6082 Conditionally expand @ann(x) to @ann(value = x) ... if the annotation has an argument with the name `value`. Doing so unconditionally obscures error messages. We still require that arguments to ClassFileAnnotations are named, other than for this special case. --- test/files/neg/t6082.check | 13 +++++++++++++ test/files/neg/t6082.scala | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 test/files/neg/t6082.check create mode 100644 test/files/neg/t6082.scala (limited to 'test') diff --git a/test/files/neg/t6082.check b/test/files/neg/t6082.check new file mode 100644 index 0000000000..b68de5ce08 --- /dev/null +++ b/test/files/neg/t6082.check @@ -0,0 +1,13 @@ +t6082.scala:1: warning: Implementation restriction: subclassing Classfile does not +make your annotation visible at runtime. If that is what +you want, you must write the annotation class in Java. +class annot(notValue: String) extends annotation.ClassfileAnnotation + ^ +t6082.scala:2: error: classfile annotation arguments have to be supplied as named arguments +@annot("") class C + ^ +t6082.scala:2: error: annotation annot is missing argument notValue +@annot("") class C + ^ +one warning found +two errors found diff --git a/test/files/neg/t6082.scala b/test/files/neg/t6082.scala new file mode 100644 index 0000000000..30de91a4c9 --- /dev/null +++ b/test/files/neg/t6082.scala @@ -0,0 +1,2 @@ +class annot(notValue: String) extends annotation.ClassfileAnnotation +@annot("") class C \ No newline at end of file -- cgit v1.2.3