summaryrefslogtreecommitdiff
path: root/test/files/run/t3897
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-11 05:19:47 +0000
committerPaul Phillips <paulp@improving.org>2010-11-11 05:19:47 +0000
commit19b12e8e0fa68ae922cfbc405815698859e106f0 (patch)
treecd5f9885a850a75c7dd11a51de9b021213c5affa /test/files/run/t3897
parent82770a97b82f07a1cbbf133c123e4e5aa982d336 (diff)
downloadscala-19b12e8e0fa68ae922cfbc405815698859e106f0.tar.gz
scala-19b12e8e0fa68ae922cfbc405815698859e106f0.tar.bz2
scala-19b12e8e0fa68ae922cfbc405815698859e106f0.zip
Unsuppressed generic signatures for members wit...
Unsuppressed generic signatures for members with expanded names. Closes #3897, review by dragos.
Diffstat (limited to 'test/files/run/t3897')
-rw-r--r--test/files/run/t3897/J_2.java23
-rw-r--r--test/files/run/t3897/a_1.scala8
-rw-r--r--test/files/run/t3897/a_2.scala13
3 files changed, 44 insertions, 0 deletions
diff --git a/test/files/run/t3897/J_2.java b/test/files/run/t3897/J_2.java
new file mode 100644
index 0000000000..5d5131737e
--- /dev/null
+++ b/test/files/run/t3897/J_2.java
@@ -0,0 +1,23 @@
+import java.lang.reflect.*;
+
+public class J_2 {
+ public void f1(Class<?> clazz) {
+ Field[] fields = clazz.getDeclaredFields();
+ for (int i = 0 ; i < fields.length; i++) {
+ System.out.println("(" + fields[i].getName() + "," + fields[i].getGenericType() + ")");
+ }
+ }
+ public void f2(Class<?> clazz) {
+ Method[] methods = clazz.getDeclaredMethods();
+ for (int i = 0 ; i < methods.length; i++) {
+ System.out.println("(" + methods[i].getName() + "," + methods[i].getGenericReturnType() + ")");
+ }
+ }
+
+ public void javaRun() {
+ f1(One.class);
+ f2(One.class);
+ f1(Two.class);
+ f2(Two.class);
+ }
+} \ No newline at end of file
diff --git a/test/files/run/t3897/a_1.scala b/test/files/run/t3897/a_1.scala
new file mode 100644
index 0000000000..4da959e2ac
--- /dev/null
+++ b/test/files/run/t3897/a_1.scala
@@ -0,0 +1,8 @@
+class One {
+ private val messages = new collection.mutable.MutableList[String]
+ List("a") foreach { messages += _ }
+}
+
+class Two {
+ private val messages = new collection.mutable.MutableList[String]
+}
diff --git a/test/files/run/t3897/a_2.scala b/test/files/run/t3897/a_2.scala
new file mode 100644
index 0000000000..da5f8df63e
--- /dev/null
+++ b/test/files/run/t3897/a_2.scala
@@ -0,0 +1,13 @@
+object Test {
+ def f1(clazz: Class[_]) = clazz.getDeclaredFields.toList map (f => (f.getName, f.getGenericType)) foreach println
+ def f2(clazz: Class[_]) = clazz.getDeclaredMethods.toList map (f => (f.getName, f.getGenericReturnType)) foreach println
+
+ def main(args: Array[String]): Unit = {
+ f1(classOf[One])
+ f2(classOf[One])
+ f1(classOf[Two])
+ f2(classOf[Two])
+
+ new J_2().javaRun
+ }
+}