diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-10-28 12:08:55 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2016-10-28 12:08:55 +0200 |
commit | ae17256f1dcde4dd82008c6e355604d68d5a07b3 (patch) | |
tree | 6eb8e3ce569eaaa41a93fc34c9942f9810012822 /test/files/pos | |
parent | 47050ee4934f5bf78339c5d81583ab445a4318dd (diff) | |
download | scala-ae17256f1dcde4dd82008c6e355604d68d5a07b3.tar.gz scala-ae17256f1dcde4dd82008c6e355604d68d5a07b3.tar.bz2 scala-ae17256f1dcde4dd82008c6e355604d68d5a07b3.zip |
For scala classfiles, only parse the scala signature annotation
Skipping other annotations not only saves some cycles / GC, but also
prevents some spurious warnings / errors related to cyclic dependencies
when parsing annotation arguments refering to members of the class.
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t5165b.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t7014/ThreadSafety.java | 9 | ||||
-rw-r--r-- | test/files/pos/t7014/ThreadSafetyLevel.java | 8 | ||||
-rw-r--r-- | test/files/pos/t7014/t7014.scala | 3 | ||||
-rw-r--r-- | test/files/pos/t7551.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t7551/A.java | 9 | ||||
-rw-r--r-- | test/files/pos/t7551/T.scala | 9 | ||||
-rw-r--r-- | test/files/pos/t7551/Test.scala | 5 |
8 files changed, 25 insertions, 20 deletions
diff --git a/test/files/pos/t5165b.flags b/test/files/pos/t5165b.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t5165b.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t7014/ThreadSafety.java b/test/files/pos/t7014/ThreadSafety.java deleted file mode 100644 index ed508804e3..0000000000 --- a/test/files/pos/t7014/ThreadSafety.java +++ /dev/null @@ -1,9 +0,0 @@ -package t7014; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.RUNTIME) // must be exactly RUNTIME retention (those we parse) -public @interface ThreadSafety { - ThreadSafetyLevel level(); -}
\ No newline at end of file diff --git a/test/files/pos/t7014/ThreadSafetyLevel.java b/test/files/pos/t7014/ThreadSafetyLevel.java deleted file mode 100644 index 4df1dc787a..0000000000 --- a/test/files/pos/t7014/ThreadSafetyLevel.java +++ /dev/null @@ -1,8 +0,0 @@ -package t7014; // package needed due to other bug in scalac's java parser - -// since we parse eagerly, we have not yet parsed the classfile when parsing the annotation, -// and on doing so, fail to find a symbol for the COMPLETELY_THREADSAFE reference -// from the annotation's argument to the enum's member -// for now, let's just not crash -- should implement lazy completing at some point -@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) -public enum ThreadSafetyLevel { COMPLETELY_THREADSAFE } diff --git a/test/files/pos/t7014/t7014.scala b/test/files/pos/t7014/t7014.scala deleted file mode 100644 index 7c73f700be..0000000000 --- a/test/files/pos/t7014/t7014.scala +++ /dev/null @@ -1,3 +0,0 @@ -package t7014 - -import ThreadSafetyLevel.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed diff --git a/test/files/pos/t7551.flags b/test/files/pos/t7551.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t7551.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t7551/A.java b/test/files/pos/t7551/A.java new file mode 100644 index 0000000000..72aeb40fa0 --- /dev/null +++ b/test/files/pos/t7551/A.java @@ -0,0 +1,9 @@ +package p; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface A { + Class<?> subInterface(); +} diff --git a/test/files/pos/t7551/T.scala b/test/files/pos/t7551/T.scala new file mode 100644 index 0000000000..017926e0e2 --- /dev/null +++ b/test/files/pos/t7551/T.scala @@ -0,0 +1,9 @@ +package p + +@A(subInterface = classOf[T.S]) +trait T { +} + +object T { + private[p] trait S extends T { } +} diff --git a/test/files/pos/t7551/Test.scala b/test/files/pos/t7551/Test.scala new file mode 100644 index 0000000000..c1f529c4b1 --- /dev/null +++ b/test/files/pos/t7551/Test.scala @@ -0,0 +1,5 @@ +package p + +object Foo { + def bar(t: T) { } +} |