Skip to content

Commit f2bc17d

Browse files
committed
Java annotations parsing problem
Annotations in java could be compiled as-if array-only annotation had <repeated> 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.
1 parent 6f1ade0 commit f2bc17d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/pos/annot.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import java.beans.Transient
22

33
class Test {
44

5-
@SuppressWarnings(Array("hi")) def foo() = ???
5+
@SuppressWarnings(Array("hi")) def foo() = ??? // evalutation of annotation on type cannot be deffered as requires implicit resolution(only generic Array$.apply applies here)
6+
7+
@SuppressWarnings(Array("hi", "foo")) def foo2() = ??? //can be deffered as there is a non-generic method
8+
9+
// @SuppressWarnings("hi") def foo3() = ??? // can be written in java and is serialized this way in bytecode. doesn't typecheck
610

711
@Transient(false) def bar = ???
812

0 commit comments

Comments
 (0)