summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/reflection-java-annotations.check22
-rw-r--r--test/files/run/reflection-java-annotations.jar.desired.sha11
-rw-r--r--test/files/run/reflection-java-annotations.scala20
-rw-r--r--test/files/run/t6329_repl.check13
-rw-r--r--test/files/run/t6329_repl.scala8
-rw-r--r--test/files/run/t6329_repl_bug.check13
-rw-r--r--test/files/run/t6329_repl_bug.pending10
-rw-r--r--test/files/run/t6329_vanilla.check2
-rw-r--r--test/files/run/t6329_vanilla.scala4
-rw-r--r--test/files/run/t6329_vanilla_bug.check2
-rw-r--r--test/files/run/t6329_vanilla_bug.pending7
11 files changed, 102 insertions, 0 deletions
diff --git a/test/files/run/reflection-java-annotations.check b/test/files/run/reflection-java-annotations.check
new file mode 100644
index 0000000000..84cfd03358
--- /dev/null
+++ b/test/files/run/reflection-java-annotations.check
@@ -0,0 +1,22 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.runtime.universe._
+import scala.reflect.runtime.universe._
+
+scala> val sym = typeOf[Foo].typeSymbol
+sym: reflect.runtime.universe.Symbol = class Foo
+
+scala> sym.typeSignature
+res0: reflect.runtime.universe.Type = java.lang.Object{def <init>(): Foo}
+
+scala> sym.getAnnotations foreach (_.javaArgs)
+
+scala> println(sym.getAnnotations)
+List(ComplexAnnotation(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[Foo], v110 = ["hello", "world"], v111 = [classOf[SimpleAnnotation], classOf[ComplexAnnotation]], v113 = [SimpleAnnotation(v1 = 21, v10 = "world2", v11 = classOf[ComplexAnnotation], v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v13 = SimpleAnnotation(v1 = 11, v10 = "world1", v11 = classOf[SimpleAnnotation], v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false))
+
+scala>
+
+scala>
diff --git a/test/files/run/reflection-java-annotations.jar.desired.sha1 b/test/files/run/reflection-java-annotations.jar.desired.sha1
new file mode 100644
index 0000000000..430e7626e6
--- /dev/null
+++ b/test/files/run/reflection-java-annotations.jar.desired.sha1
@@ -0,0 +1 @@
+c35876a529c6be33bdda7b3f48ac8ae800d2f36a ?reflection-java-annotations.jar
diff --git a/test/files/run/reflection-java-annotations.scala b/test/files/run/reflection-java-annotations.scala
new file mode 100644
index 0000000000..4a4fe2572d
--- /dev/null
+++ b/test/files/run/reflection-java-annotations.scala
@@ -0,0 +1,20 @@
+import scala.tools.partest._
+import scala.tools.nsc.Settings
+
+object Test extends ReplTest {
+ def code = """
+ import scala.reflect.runtime.universe._
+ val sym = typeOf[Foo].typeSymbol
+ sym.typeSignature
+ sym.getAnnotations foreach (_.javaArgs)
+ println(sym.getAnnotations)
+ """
+
+ override def transformSettings(settings: Settings): Settings = {
+ val thisFile = testPath.jfile.getAbsolutePath
+ val javaCompiledAnnotationsJar = (thisFile stripSuffix "scala") + "jar"
+ val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect"), sys.props("partest.comp"), javaCompiledAnnotationsJar) mkString sys.props("path.separator")
+ settings.processArguments(List("-cp", classpath), true)
+ settings
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t6329_repl.check b/test/files/run/t6329_repl.check
new file mode 100644
index 0000000000..d4804fae37
--- /dev/null
+++ b/test/files/run/t6329_repl.check
@@ -0,0 +1,13 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> classManifest[List[_]]
+warning: there were 1 deprecation warnings; re-run with -deprecation for details
+res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[Any]
+
+scala> scala.reflect.classTag[List[_]]
+res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
+
+scala>
diff --git a/test/files/run/t6329_repl.scala b/test/files/run/t6329_repl.scala
new file mode 100644
index 0000000000..add6d64962
--- /dev/null
+++ b/test/files/run/t6329_repl.scala
@@ -0,0 +1,8 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |classManifest[List[_]]
+ |scala.reflect.classTag[List[_]]
+ |""".stripMargin
+}
diff --git a/test/files/run/t6329_repl_bug.check b/test/files/run/t6329_repl_bug.check
new file mode 100644
index 0000000000..d4804fae37
--- /dev/null
+++ b/test/files/run/t6329_repl_bug.check
@@ -0,0 +1,13 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> classManifest[List[_]]
+warning: there were 1 deprecation warnings; re-run with -deprecation for details
+res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[Any]
+
+scala> scala.reflect.classTag[List[_]]
+res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
+
+scala>
diff --git a/test/files/run/t6329_repl_bug.pending b/test/files/run/t6329_repl_bug.pending
new file mode 100644
index 0000000000..9997d1771e
--- /dev/null
+++ b/test/files/run/t6329_repl_bug.pending
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.reflect.runtime.universe._
+ |import scala.reflect.runtime._
+ |classManifest[List[_]]
+ |scala.reflect.classTag[List[_]]
+ |""".stripMargin
+}
diff --git a/test/files/run/t6329_vanilla.check b/test/files/run/t6329_vanilla.check
new file mode 100644
index 0000000000..7e7c3d11df
--- /dev/null
+++ b/test/files/run/t6329_vanilla.check
@@ -0,0 +1,2 @@
+scala.collection.immutable.List[Any]
+scala.collection.immutable.List
diff --git a/test/files/run/t6329_vanilla.scala b/test/files/run/t6329_vanilla.scala
new file mode 100644
index 0000000000..a31cd5c72e
--- /dev/null
+++ b/test/files/run/t6329_vanilla.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println(classManifest[List[_]])
+ println(scala.reflect.classTag[List[_]])
+} \ No newline at end of file
diff --git a/test/files/run/t6329_vanilla_bug.check b/test/files/run/t6329_vanilla_bug.check
new file mode 100644
index 0000000000..7e7c3d11df
--- /dev/null
+++ b/test/files/run/t6329_vanilla_bug.check
@@ -0,0 +1,2 @@
+scala.collection.immutable.List[Any]
+scala.collection.immutable.List
diff --git a/test/files/run/t6329_vanilla_bug.pending b/test/files/run/t6329_vanilla_bug.pending
new file mode 100644
index 0000000000..404f90bf6e
--- /dev/null
+++ b/test/files/run/t6329_vanilla_bug.pending
@@ -0,0 +1,7 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime._
+
+object Test extends App {
+ println(classManifest[List[_]])
+ println(scala.reflect.classTag[List[_]])
+} \ No newline at end of file