summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-04 20:28:56 -0700
committerPaul Phillips <paulp@improving.org>2012-10-04 21:28:45 -0700
commit5240da5073168424db50b969c1bbf7089d0a4242 (patch)
treedc2d8a1ce08200db02ff433f26a5dcacaab150e9 /test/files
parent6d6c182ae1b25919c573373ea27759041f579e4c (diff)
downloadscala-5240da5073168424db50b969c1bbf7089d0a4242.tar.gz
scala-5240da5073168424db50b969c1bbf7089d0a4242.tar.bz2
scala-5240da5073168424db50b969c1bbf7089d0a4242.zip
Moved a bunch of passing tests out of pending.
If the test names can be believed, this covers SI-294 SI-1751 SI-1782 SI-2318 SI-3897 SI-4649 SI-4786 SI-5293 SI-5399 SI-5418 SI-5606 SI-5610 SI-5639 Most of these were moved to pending in 1729b26500 due to failures of unknown cause. It was suggested they be brought back "as soon as possible" and that was three months ago; I suppose it's now possible. If they need to be disabled again, please move them to test/disabled, not to test/pending. "disabled" should mean a formerly passing test in limbo; "pending" tests document bugs which await fixing. I also removed some dead files in test/ - the files with a "cmds" extension are from a failed experiment and do not do anything.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/t2470.cmds3
-rw-r--r--test/files/jvm/t3003.cmds2
-rw-r--r--test/files/pos/exhaust_2.scala54
-rw-r--r--test/files/pos/no-widen-locals.scala19
-rw-r--r--test/files/pos/super.cmds2
-rw-r--r--test/files/pos/t1029.cmds2
-rw-r--r--test/files/pos/t1751/A1_2.scala2
-rw-r--r--test/files/pos/t1751/A2_1.scala2
-rw-r--r--test/files/pos/t1751/SuiteClasses.java3
-rw-r--r--test/files/pos/t1782/Ann.java3
-rw-r--r--test/files/pos/t1782/Days.java3
-rw-r--r--test/files/pos/t1782/ImplementedBy.java3
-rw-r--r--test/files/pos/t1782/Test_1.scala16
-rw-r--r--test/files/pos/t1942.cmds2
-rw-r--r--test/files/pos/t2464.cmds3
-rw-r--r--test/files/pos/t2726.cmds2
-rw-r--r--test/files/pos/t294/Ann.java3
-rw-r--r--test/files/pos/t294/Ann2.java3
-rw-r--r--test/files/pos/t294/Test_1.scala7
-rw-r--r--test/files/pos/t294/Test_2.scala1
-rw-r--r--test/files/pos/t4649.flags1
-rw-r--r--test/files/pos/t4649.scala6
-rw-r--r--test/files/pos/t4786.scala24
-rw-r--r--test/files/pos/t5399a.scala19
-rw-r--r--test/files/pos/t5606.scala9
-rw-r--r--test/files/pos/t5639/Bar.scala7
-rw-r--r--test/files/pos/t5639/Foo.scala7
-rw-r--r--test/files/pos/t715.cmds2
-rw-r--r--test/files/run/reify_implicits-new.check1
-rw-r--r--test/files/run/reify_implicits-new.scala16
-rw-r--r--test/files/run/reify_implicits-old.check1
-rw-r--r--test/files/run/reify_implicits-old.scala15
-rw-r--r--test/files/run/t2318.check2
-rw-r--r--test/files/run/t2318.scala38
-rw-r--r--test/files/run/t3897.check8
-rw-r--r--test/files/run/t3897/J_2.java27
-rw-r--r--test/files/run/t3897/a_1.scala8
-rw-r--r--test/files/run/t3897/a_2.scala23
-rw-r--r--test/files/run/t5293-map.scala88
-rw-r--r--test/files/run/t5293.scala83
-rw-r--r--test/files/run/t5418.check0
-rw-r--r--test/files/run/t5418.scala8
-rw-r--r--test/files/run/t5610a.check1
-rw-r--r--test/files/run/t5610a.scala19
44 files changed, 530 insertions, 18 deletions
diff --git a/test/files/jvm/t2470.cmds b/test/files/jvm/t2470.cmds
deleted file mode 100644
index b4ef0f4aeb..0000000000
--- a/test/files/jvm/t2470.cmds
+++ /dev/null
@@ -1,3 +0,0 @@
-javac Action.java Task.java
-scalac Test_1.scala
-scalac Read_Classfile_2.scala
diff --git a/test/files/jvm/t3003.cmds b/test/files/jvm/t3003.cmds
deleted file mode 100644
index c00396627c..0000000000
--- a/test/files/jvm/t3003.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-javac Annot.java
-scalac Test_1.scala
diff --git a/test/files/pos/exhaust_2.scala b/test/files/pos/exhaust_2.scala
new file mode 100644
index 0000000000..4f4e47c43b
--- /dev/null
+++ b/test/files/pos/exhaust_2.scala
@@ -0,0 +1,54 @@
+object ExhaustivityWarnBugReportMinimal {
+ //sealed is needed for the warning
+ sealed trait FoundNode[T]/*presence of parameters is irrelevant*/
+ // This also causes a warning:
+ // sealed abstract class FoundNode[T]/*presence of parameters is irrelevant*/
+ case class FoundFilter[T](/*presence of parameters is irrelevant*/) extends FoundNode[T]
+ case class FoundTypeCase[T](/*presence of parameters is irrelevant*/) extends FoundNode[T]
+ val f: Some[_] = ???
+ f match {
+ case x: Some[t] => //no warning
+ }
+ //With these variants, no warnings:
+ //val v: (Some[Int], FoundNode[_]) = (???, ???)
+ //val v: (Some[AnyRef], FoundNode[_]) = (???, ???)
+ //val v: (Some[String], FoundNode[_]) = (???, ???)
+
+ val v: (Some[_], FoundNode[_]) = (???, ???)
+ //Warning here:
+ v match {
+ case (x: Some[t], _: FoundNode[_]) =>
+ }
+ v match {
+ case (x: Some[t], _) =>
+ }
+
+ v match {
+ case (x: Some[_], _) =>
+ }
+ case class Foo[T]()
+
+ val vp: (Foo[_], FoundNode[_]) = (???, ???)
+ vp match {
+ case (x: Foo[_], _) =>
+ }
+
+ //No warning here:
+ v match {
+ case (Some(y), _) =>
+ }
+
+ v match {
+ case (x, _) =>
+ }
+
+ val v2: (Some[_], Int) = (???, ???)
+ v2 match {
+ case (x: Some[t], _) =>
+ }
+
+ val v3: (Option[_], FoundNode[_]) = (???, ???)
+ v match {
+ case (x: Option[_], _) =>
+ }
+}
diff --git a/test/files/pos/no-widen-locals.scala b/test/files/pos/no-widen-locals.scala
new file mode 100644
index 0000000000..013e63f0a2
--- /dev/null
+++ b/test/files/pos/no-widen-locals.scala
@@ -0,0 +1,19 @@
+// Worked from r23262 until that was reverted somewhere
+// around r25016.
+import annotation.switch
+
+object Test {
+ def f(x: Int) = {
+ val X1 = 5
+ val X2 = 10
+ val X3 = 15
+ val X4 = 20
+
+ (x: @switch) match {
+ case X1 => 1
+ case X2 => 2
+ case X3 => 3
+ case X4 => 4
+ }
+ }
+}
diff --git a/test/files/pos/super.cmds b/test/files/pos/super.cmds
deleted file mode 100644
index 8f3f8a4172..0000000000
--- a/test/files/pos/super.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-javac Super_1.java
-scalac Super_2.scala
diff --git a/test/files/pos/t1029.cmds b/test/files/pos/t1029.cmds
deleted file mode 100644
index 06b863dc03..0000000000
--- a/test/files/pos/t1029.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-scalac Test_1.scala
-scalac Test_2.scala
diff --git a/test/files/pos/t1751/A1_2.scala b/test/files/pos/t1751/A1_2.scala
new file mode 100644
index 0000000000..354d5eecd0
--- /dev/null
+++ b/test/files/pos/t1751/A1_2.scala
@@ -0,0 +1,2 @@
+@SuiteClasses(Array(classOf[A2]))
+class A1
diff --git a/test/files/pos/t1751/A2_1.scala b/test/files/pos/t1751/A2_1.scala
new file mode 100644
index 0000000000..c768062e43
--- /dev/null
+++ b/test/files/pos/t1751/A2_1.scala
@@ -0,0 +1,2 @@
+@SuiteClasses(Array())
+class A2
diff --git a/test/files/pos/t1751/SuiteClasses.java b/test/files/pos/t1751/SuiteClasses.java
new file mode 100644
index 0000000000..a415e4f572
--- /dev/null
+++ b/test/files/pos/t1751/SuiteClasses.java
@@ -0,0 +1,3 @@
+public @interface SuiteClasses {
+ public Class<?>[] value();
+}
diff --git a/test/files/pos/t1782/Ann.java b/test/files/pos/t1782/Ann.java
new file mode 100644
index 0000000000..0dcfbd2ed7
--- /dev/null
+++ b/test/files/pos/t1782/Ann.java
@@ -0,0 +1,3 @@
+public @interface Ann {
+ public Days value();
+}
diff --git a/test/files/pos/t1782/Days.java b/test/files/pos/t1782/Days.java
new file mode 100644
index 0000000000..203a87b1c2
--- /dev/null
+++ b/test/files/pos/t1782/Days.java
@@ -0,0 +1,3 @@
+public enum Days {
+ Friday, Sunday
+}
diff --git a/test/files/pos/t1782/ImplementedBy.java b/test/files/pos/t1782/ImplementedBy.java
new file mode 100644
index 0000000000..6aa8b4fa9e
--- /dev/null
+++ b/test/files/pos/t1782/ImplementedBy.java
@@ -0,0 +1,3 @@
+public @interface ImplementedBy {
+ public Class<?> value();
+}
diff --git a/test/files/pos/t1782/Test_1.scala b/test/files/pos/t1782/Test_1.scala
new file mode 100644
index 0000000000..6467a74c29
--- /dev/null
+++ b/test/files/pos/t1782/Test_1.scala
@@ -0,0 +1,16 @@
+@ImplementedBy(classOf[Provider])
+trait Service {
+ def someMethod()
+}
+
+class Provider
+ extends Service
+{
+ // test enumeration java annotations
+ @Ann(Days.Friday) def someMethod() = ()
+
+ // #2103
+ @scala.beans.BeanProperty
+ @Ann(value = Days.Sunday)
+ val t2103 = "test"
+}
diff --git a/test/files/pos/t1942.cmds b/test/files/pos/t1942.cmds
deleted file mode 100644
index c14311042a..0000000000
--- a/test/files/pos/t1942.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-scalac A_1.scala
-scalac Test_2.scala
diff --git a/test/files/pos/t2464.cmds b/test/files/pos/t2464.cmds
deleted file mode 100644
index ca733ef23d..0000000000
--- a/test/files/pos/t2464.cmds
+++ /dev/null
@@ -1,3 +0,0 @@
-javac JavaOne.java
-scalac ScalaOne_1.scala
-scalac t2464_2.scala
diff --git a/test/files/pos/t2726.cmds b/test/files/pos/t2726.cmds
deleted file mode 100644
index 5fcb18bfbb..0000000000
--- a/test/files/pos/t2726.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-scalac SQLBuilder_1.scala
-scalac test_2.scala
diff --git a/test/files/pos/t294/Ann.java b/test/files/pos/t294/Ann.java
new file mode 100644
index 0000000000..934ca46297
--- /dev/null
+++ b/test/files/pos/t294/Ann.java
@@ -0,0 +1,3 @@
+public @interface Ann {
+ public Ann2[] nested();
+}
diff --git a/test/files/pos/t294/Ann2.java b/test/files/pos/t294/Ann2.java
new file mode 100644
index 0000000000..025b79e794
--- /dev/null
+++ b/test/files/pos/t294/Ann2.java
@@ -0,0 +1,3 @@
+public @interface Ann2 {
+ public int value();
+}
diff --git a/test/files/pos/t294/Test_1.scala b/test/files/pos/t294/Test_1.scala
new file mode 100644
index 0000000000..ff1f34b10e
--- /dev/null
+++ b/test/files/pos/t294/Test_1.scala
@@ -0,0 +1,7 @@
+// also test pickling of java annotations; Test_2.scala will
+// read this class file
+@Ann(nested = Array(new Ann2(10))) class Test {
+ @Ann2(100) var ctx: Object = _
+ @Ann(nested = Array()) def foo = 10
+ @Ann(nested = Array(new Ann2(10), new Ann2(23))) val bam = -3
+}
diff --git a/test/files/pos/t294/Test_2.scala b/test/files/pos/t294/Test_2.scala
new file mode 100644
index 0000000000..9fb1c6e175
--- /dev/null
+++ b/test/files/pos/t294/Test_2.scala
@@ -0,0 +1 @@
+class Test2 extends Test
diff --git a/test/files/pos/t4649.flags b/test/files/pos/t4649.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t4649.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t4649.scala b/test/files/pos/t4649.scala
new file mode 100644
index 0000000000..0d6caa8d7a
--- /dev/null
+++ b/test/files/pos/t4649.scala
@@ -0,0 +1,6 @@
+object Test {
+ // @annotation.tailrec
+ def lazyFilter[E](s: Stream[E], p: E => Boolean): Stream[E] = s match {
+ case h #:: t => if (p(h)) h #:: lazyFilter(t, p) else lazyFilter(t, p)
+ }
+}
diff --git a/test/files/pos/t4786.scala b/test/files/pos/t4786.scala
new file mode 100644
index 0000000000..f0579142b8
--- /dev/null
+++ b/test/files/pos/t4786.scala
@@ -0,0 +1,24 @@
+trait Matrix[@specialized A, Repr[C] <: Matrix[C, Repr]] { // crash goes away if @specialize is removed
+ def duplicate(mb: MatrixBuilder[A, Repr]): Repr[A] = {
+ mb.zeros
+ }
+}
+trait DenseMatrix[@specialized A] extends Matrix[A, DenseMatrix]
+trait DenseMatrixFlt extends DenseMatrix[Float]
+
+trait MatrixBuilder[@specialized A, Repr[C] <: Matrix[C, Repr]] {
+ def zeros: Repr[A]
+}
+object DenseFloatBuilder extends MatrixBuilder[Float, DenseMatrix] {
+ val zeros = new Object with DenseMatrixFlt
+ // Note:
+ // - in 2.9 crash goes away if the explicit type "DenseMatrixFlt" is assigned to "zeros"
+ // - in 2.9 crash goes away if DenseMatrixFlt is a class instead of a trait:
+ // val zeros = new DenseMatrixFlt
+}
+
+object Test extends App {
+ val m1 = DenseFloatBuilder.zeros // in 2.9 crash goes away if explicit type "DenseMatrixFlt" is assigned to m1
+ val m2 = m1.duplicate(DenseFloatBuilder)
+}
+
diff --git a/test/files/pos/t5399a.scala b/test/files/pos/t5399a.scala
new file mode 100644
index 0000000000..4ebd85ad03
--- /dev/null
+++ b/test/files/pos/t5399a.scala
@@ -0,0 +1,19 @@
+class Foo {
+ trait Init[T]
+ class ScopedKey[T] extends Init[T]
+
+ trait Setting[T] {
+ val key: ScopedKey[T]
+ }
+
+ case class ScopedKey1[T](val foo: Init[T]) extends ScopedKey[T]
+
+ val scalaHome: Setting[Option[String]] = null
+ val scalaVersion: Setting[String] = null
+
+ def testPatternMatch(s: Setting[_]) {
+ s.key match {
+ case ScopedKey1(scalaHome.key | scalaVersion.key) => ()
+ }
+ }
+}
diff --git a/test/files/pos/t5606.scala b/test/files/pos/t5606.scala
new file mode 100644
index 0000000000..2545271e32
--- /dev/null
+++ b/test/files/pos/t5606.scala
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+case class CaseTest[_](someData:String)
diff --git a/test/files/pos/t5639/Bar.scala b/test/files/pos/t5639/Bar.scala
new file mode 100644
index 0000000000..f577500acd
--- /dev/null
+++ b/test/files/pos/t5639/Bar.scala
@@ -0,0 +1,7 @@
+package pack.age
+
+import pack.age.Implicits._
+
+object Quux {
+ def baz : Baz = 1
+}
diff --git a/test/files/pos/t5639/Foo.scala b/test/files/pos/t5639/Foo.scala
new file mode 100644
index 0000000000..6602150661
--- /dev/null
+++ b/test/files/pos/t5639/Foo.scala
@@ -0,0 +1,7 @@
+package pack.age
+
+class Baz
+
+object Implicits {
+ implicit def Baz(n: Int): Baz = new Baz
+}
diff --git a/test/files/pos/t715.cmds b/test/files/pos/t715.cmds
deleted file mode 100644
index 2836967fca..0000000000
--- a/test/files/pos/t715.cmds
+++ /dev/null
@@ -1,2 +0,0 @@
-scalac meredith_1.scala
-scalac runner_2.scala
diff --git a/test/files/run/reify_implicits-new.check b/test/files/run/reify_implicits-new.check
new file mode 100644
index 0000000000..e3aeb20f6b
--- /dev/null
+++ b/test/files/run/reify_implicits-new.check
@@ -0,0 +1 @@
+x = List(1, 2, 3, 4)
diff --git a/test/files/run/reify_implicits-new.scala b/test/files/run/reify_implicits-new.scala
new file mode 100644
index 0000000000..42a1deef26
--- /dev/null
+++ b/test/files/run/reify_implicits-new.scala
@@ -0,0 +1,16 @@
+import scala.reflect.{ClassTag, classTag}
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ reify {
+ implicit def arrayWrapper[A : ClassTag](x: Array[A]) =
+ new {
+ def sort(p: (A, A) => Boolean) = {
+ util.Sorting.stableSort(x, p); x
+ }
+ }
+ val x = Array(2, 3, 1, 4)
+ println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
+ }.eval
+} \ No newline at end of file
diff --git a/test/files/run/reify_implicits-old.check b/test/files/run/reify_implicits-old.check
new file mode 100644
index 0000000000..e3aeb20f6b
--- /dev/null
+++ b/test/files/run/reify_implicits-old.check
@@ -0,0 +1 @@
+x = List(1, 2, 3, 4)
diff --git a/test/files/run/reify_implicits-old.scala b/test/files/run/reify_implicits-old.scala
new file mode 100644
index 0000000000..8ff256d2d4
--- /dev/null
+++ b/test/files/run/reify_implicits-old.scala
@@ -0,0 +1,15 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ reify {
+ implicit def arrayWrapper[A : ClassManifest](x: Array[A]) =
+ new {
+ def sort(p: (A, A) => Boolean) = {
+ util.Sorting.stableSort(x, p); x
+ }
+ }
+ val x = Array(2, 3, 1, 4)
+ println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
+ }.eval
+} \ No newline at end of file
diff --git a/test/files/run/t2318.check b/test/files/run/t2318.check
new file mode 100644
index 0000000000..a486f1ac47
--- /dev/null
+++ b/test/files/run/t2318.check
@@ -0,0 +1,2 @@
+bar
+bar
diff --git a/test/files/run/t2318.scala b/test/files/run/t2318.scala
new file mode 100644
index 0000000000..e42cbb9680
--- /dev/null
+++ b/test/files/run/t2318.scala
@@ -0,0 +1,38 @@
+import java.security._
+
+object Test {
+ trait Bar { def bar: Unit }
+
+ object Mgr extends SecurityManager {
+ override def checkPermission(perm: Permission) = perm match {
+ case _: java.lang.RuntimePermission => ()
+ case _: java.io.FilePermission => ()
+ case x: java.security.AccessControlException if x.getName contains ".networkaddress." => () // generality ftw
+ case _ => super.checkPermission(perm)
+ }
+ }
+
+ def t1() = {
+ val p = Runtime.getRuntime().exec("ls");
+ type Destroyable = { def destroy() : Unit }
+ def doDestroy( obj : Destroyable ) : Unit = obj.destroy();
+ doDestroy( p );
+ }
+ def t2() = {
+ System.setSecurityManager(Mgr)
+
+ val b = new Bar { def bar = println("bar") }
+ b.bar
+
+ val structural = b.asInstanceOf[{ def bar: Unit }]
+ structural.bar
+ }
+
+ def main(args: Array[String]) {
+ // figuring this will otherwise break on windows
+ try t1()
+ catch { case _: java.io.IOException => () }
+
+ t2()
+ }
+}
diff --git a/test/files/run/t3897.check b/test/files/run/t3897.check
new file mode 100644
index 0000000000..244b83716f
--- /dev/null
+++ b/test/files/run/t3897.check
@@ -0,0 +1,8 @@
+(One$$messages,scala.collection.mutable.MutableList<java.lang.String>)
+(One$$messages,scala.collection.mutable.MutableList<java.lang.String>)
+(messages,scala.collection.mutable.MutableList<java.lang.String>)
+(messages,scala.collection.mutable.MutableList<java.lang.String>)
+(One$$messages,scala.collection.mutable.MutableList<java.lang.String>)
+(One$$messages,scala.collection.mutable.MutableList<java.lang.String>)
+(messages,scala.collection.mutable.MutableList<java.lang.String>)
+(messages,scala.collection.mutable.MutableList<java.lang.String>)
diff --git a/test/files/run/t3897/J_2.java b/test/files/run/t3897/J_2.java
new file mode 100644
index 0000000000..178412dc92
--- /dev/null
+++ b/test/files/run/t3897/J_2.java
@@ -0,0 +1,27 @@
+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++) {
+ String name = fields[i].getName();
+ if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { }
+ else System.out.println("(" + name + "," + fields[i].getGenericType() + ")");
+ }
+ }
+ public void f2(Class<?> clazz) {
+ Method[] methods = clazz.getDeclaredMethods();
+ for (int i = 0 ; i < methods.length; i++) {
+ String name = methods[i].getName();
+ if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { }
+ else System.out.println("(" + name + "," + 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..4d9e59ef05
--- /dev/null
+++ b/test/files/run/t3897/a_2.scala
@@ -0,0 +1,23 @@
+object Test {
+ def f1(clazz: Class[_]) = (
+ clazz.getDeclaredFields.toList
+ . filterNot (_.getName contains "bitmap$")
+ . map (f => (f.getName, f.getGenericType))
+ . foreach (println)
+ )
+ def f2(clazz: Class[_]) = (
+ clazz.getDeclaredMethods.toList
+ . filterNot (_.getName contains "bitmap$")
+ . 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
+ }
+}
diff --git a/test/files/run/t5293-map.scala b/test/files/run/t5293-map.scala
new file mode 100644
index 0000000000..2707aed07e
--- /dev/null
+++ b/test/files/run/t5293-map.scala
@@ -0,0 +1,88 @@
+
+
+
+import scala.collection.JavaConverters._
+
+
+
+object Test extends App {
+
+ def bench(label: String)(body: => Unit): Long = {
+ val start = System.nanoTime
+
+ 0.until(10).foreach(_ => body)
+
+ val end = System.nanoTime
+
+ //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0))
+
+ end - start
+ }
+
+ def benchJava(values: java.util.Map[Int, Int]) = {
+ bench("Java Map") {
+ val m = new java.util.HashMap[Int, Int]
+
+ m.putAll(values)
+ }
+ }
+
+ def benchScala(values: Iterable[(Int, Int)]) = {
+ bench("Scala Map") {
+ val m = new scala.collection.mutable.HashMap[Int, Int]
+
+ m ++= values
+ }
+ }
+
+ def benchScalaSorted(values: Iterable[(Int, Int)]) = {
+ bench("Scala Map sorted") {
+ val m = new scala.collection.mutable.HashMap[Int, Int]
+
+ m ++= values.toArray.sorted
+ }
+ }
+
+ def benchScalaPar(values: Iterable[(Int, Int)]) = {
+ bench("Scala ParMap") {
+ val m = new scala.collection.parallel.mutable.ParHashMap[Int, Int] map { x => x }
+
+ m ++= values
+ }
+ }
+
+ val total = 50000
+ val values = (0 until total) zip (0 until total)
+ val map = scala.collection.mutable.HashMap.empty[Int, Int]
+
+ map ++= values
+
+ // warmup
+ for (x <- 0 until 5) {
+ benchJava(map.asJava)
+ benchScala(map)
+ benchScalaPar(map)
+ benchJava(map.asJava)
+ benchScala(map)
+ benchScalaPar(map)
+ }
+
+ val javamap = benchJava(map.asJava)
+ val scalamap = benchScala(map)
+ val scalaparmap = benchScalaPar(map)
+
+ // println(javamap)
+ // println(scalamap)
+ // println(scalaparmap)
+
+ assert(scalamap < (javamap * 10), "scalamap: " + scalamap + " vs. javamap: " + javamap)
+ assert(scalaparmap < (javamap * 10), "scalaparmap: " + scalaparmap + " vs. javamap: " + javamap)
+}
+
+
+
+
+
+
+
+
diff --git a/test/files/run/t5293.scala b/test/files/run/t5293.scala
new file mode 100644
index 0000000000..01ead45d2a
--- /dev/null
+++ b/test/files/run/t5293.scala
@@ -0,0 +1,83 @@
+
+
+
+import scala.collection.JavaConverters._
+
+
+
+object Test extends App {
+
+ def bench(label: String)(body: => Unit): Long = {
+ val start = System.nanoTime
+
+ 0.until(10).foreach(_ => body)
+
+ val end = System.nanoTime
+
+ //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0))
+
+ end - start
+ }
+
+ def benchJava(values: java.util.Collection[Int]) = {
+ bench("Java Set") {
+ val set = new java.util.HashSet[Int]
+
+ set.addAll(values)
+ }
+ }
+
+ def benchScala(values: Iterable[Int]) = {
+ bench("Scala Set") {
+ val set = new scala.collection.mutable.HashSet[Int]
+
+ set ++= values
+ }
+ }
+
+ def benchScalaSorted(values: Iterable[Int]) = {
+ bench("Scala Set sorted") {
+ val set = new scala.collection.mutable.HashSet[Int]
+
+ set ++= values.toArray.sorted
+ }
+ }
+
+ def benchScalaPar(values: Iterable[Int]) = {
+ bench("Scala ParSet") {
+ val set = new scala.collection.parallel.mutable.ParHashSet[Int] map { x => x }
+
+ set ++= values
+ }
+ }
+
+ val values = 0 until 50000
+ val set = scala.collection.mutable.HashSet.empty[Int]
+
+ set ++= values
+
+ // warmup
+ for (x <- 0 until 5) {
+ benchJava(set.asJava)
+ benchScala(set)
+ benchScalaPar(set)
+ benchJava(set.asJava)
+ benchScala(set)
+ benchScalaPar(set)
+ }
+
+ val javaset = benchJava(set.asJava)
+ val scalaset = benchScala(set)
+ val scalaparset = benchScalaPar(set)
+
+ assert(scalaset < (javaset * 8), "scalaset: " + scalaset + " vs. javaset: " + javaset)
+ assert(scalaparset < (javaset * 8), "scalaparset: " + scalaparset + " vs. javaset: " + javaset)
+}
+
+
+
+
+
+
+
+
diff --git a/test/files/run/t5418.check b/test/files/run/t5418.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5418.check
diff --git a/test/files/run/t5418.scala b/test/files/run/t5418.scala
new file mode 100644
index 0000000000..e3cb20cf82
--- /dev/null
+++ b/test/files/run/t5418.scala
@@ -0,0 +1,8 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ reify {
+ new Object().getClass
+ }.eval
+} \ No newline at end of file
diff --git a/test/files/run/t5610a.check b/test/files/run/t5610a.check
new file mode 100644
index 0000000000..2aa46b3b91
--- /dev/null
+++ b/test/files/run/t5610a.check
@@ -0,0 +1 @@
+Stroke a kitten
diff --git a/test/files/run/t5610a.scala b/test/files/run/t5610a.scala
new file mode 100644
index 0000000000..f20b295762
--- /dev/null
+++ b/test/files/run/t5610a.scala
@@ -0,0 +1,19 @@
+object Test extends App {
+ class Result(_str: => String) {
+ lazy val str = _str
+ }
+
+ def foo(str: => String)(i: Int) = new Result(str)
+
+ def bar(f: Int => Result) = f(42)
+
+ var test: String = null
+ val result = bar(foo(test))
+ test = "bar"
+
+ if (result.str == null) {
+ println("Destroy ALL THE THINGS!!!")
+ } else {
+ println("Stroke a kitten")
+ }
+} \ No newline at end of file