You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: tests/pos/annot.scala
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@ import java.beans.Transient
2
2
3
3
classTest {
4
4
5
-
@SuppressWarnings(Array("hi")) deffoo() =???
5
+
@SuppressWarnings(Array("hi")) deffoo() =???// evalutation of annotation on type cannot be deffered as requires implicit resolution(only generic Array$.apply applies here)
6
+
7
+
@SuppressWarnings(Array("hi", "foo")) deffoo2() =???//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
0 commit comments