From e2c5fcdf97e351e471e79502aa7d23bd973241ab Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 4 Nov 2014 15:22:18 +0100 Subject: Java annotations parsing problem Annotations in java could be compiled as-if array-only annotation had arguments constructor. That isn't true for scala. Also, type checking creation of single-element array requires implicit resolution to provide ClassTag. This makes problems while reading deferred annotation. --- tests/pos/annot.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/pos/annot.scala') diff --git a/tests/pos/annot.scala b/tests/pos/annot.scala index cda24e05d..ab80aba27 100644 --- a/tests/pos/annot.scala +++ b/tests/pos/annot.scala @@ -2,7 +2,11 @@ import java.beans.Transient class Test { - @SuppressWarnings(Array("hi")) def foo() = ??? + @SuppressWarnings(Array("hi")) def foo() = ??? // evalutation of annotation on type cannot be deffered as requires implicit resolution(only generic Array$.apply applies here) + + @SuppressWarnings(Array("hi", "foo")) def foo2() = ??? //can be deffered as there is a non-generic method + +// @SuppressWarnings("hi") def foo3() = ??? // can be written in java and is serialized this way in bytecode. doesn't typecheck @Transient(false) def bar = ??? -- cgit v1.2.3