diff options
Diffstat (limited to 'test/pending/run')
48 files changed, 110 insertions, 412 deletions
diff --git a/test/pending/run/hk-lub-fail.scala b/test/pending/run/hk-lub-fail.scala index b58a86ee75..0ac4fdd841 100644 --- a/test/pending/run/hk-lub-fail.scala +++ b/test/pending/run/hk-lub-fail.scala @@ -25,12 +25,12 @@ object Test { // A repl session to get you started. /* - val quux1 = EmptyPackageClass.tpe.member(newTermName("Quux1")) - val quux2 = EmptyPackageClass.tpe.member(newTermName("Quux2")) + val quux1 = EmptyPackageClass.tpe.member(TermName("Quux1")) + val quux2 = EmptyPackageClass.tpe.member(TermName("Quux2")) val tps = List(quux1, quux2) map (_.tpe) - val test = EmptyPackageClass.tpe.member(newTermName("Test")) - val f = test.tpe.member(newTypeName("F")).tpe - + val test = EmptyPackageClass.tpe.member(TermName("Test")) + val f = test.tpe.member(TypeName("F")).tpe + val fn = f.normalize.asInstanceOf[ExistentialType] val fn2 = fn.underlying.asInstanceOf[TypeRef] */ diff --git a/test/pending/run/idempotency-partial-functions.scala b/test/pending/run/idempotency-partial-functions.scala index bc0ca706dd..b26c442599 100644 --- a/test/pending/run/idempotency-partial-functions.scala +++ b/test/pending/run/idempotency-partial-functions.scala @@ -20,9 +20,9 @@ object Test extends App { case e: ToolBoxError => println(e) } val tb = cm.mkToolBox() - val tpartials = tb.typeCheck(partials.tree) + val tpartials = tb.typecheck(partials.tree) println(tpartials) - val rtpartials = tb.resetAllAttrs(tpartials) + val rtpartials = tb.untypecheck(tpartials) println(tb.eval(rtpartials)) } Test.main(null)
\ No newline at end of file diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala index 7cf8d59c75..fd5d8d7f18 100644 --- a/test/pending/run/macro-expand-default/Impls_1.scala +++ b/test/pending/run/macro-expand-default/Impls_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { + def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala index 15bcb581c8..e8170fda07 100644 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala +++ b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.Context +import scala.reflect.macros.whitebox.Context object Impls { def foo[T: c.WeakTypeTag](c: Context): c.Expr[List[T]] = c.universe.reify { diff --git a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala index be00fd0d8a..34182b7968 100644 --- a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala +++ b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { + def foo[U](c: Context)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { import c.universe._ - val plusOne = Apply(Select(evidence.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne)) + val plusOne = Apply(Select(evidence.tree, TermName("plus")), List(x.tree, Literal(Constant(1)))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(plusOne)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala index 7cf8d59c75..fd5d8d7f18 100644 --- a/test/pending/run/macro-expand-named/Impls_1.scala +++ b/test/pending/run/macro-expand-named/Impls_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { + def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala index 26de70cc12..683622b29d 100644 --- a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala @@ -1,12 +1,12 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala index 26de70cc12..683622b29d 100644 --- a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala @@ -1,12 +1,12 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Context)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } }
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala index daedde4021..741a921b72 100644 --- a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala +++ b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala @@ -1,5 +1,5 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context trait Impls { - def impl(c: Ctx)(x: c.Expr[Any]) = x + def impl(c: Context)(x: c.Expr[Any]) = x }
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala index 27140a77ad..2735321eae 100644 --- a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala +++ b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros extends Impls { def foo(x: Any) = macro impl diff --git a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala index 246fc9f904..b023d31f05 100644 --- a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala +++ b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala @@ -1,7 +1,7 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context trait ImplContainer { object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = x + def foo(c: Context)(x: c.Expr[Any]) = x } }
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala index da9445ac52..639d93fb5f 100644 --- a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala +++ b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros extends ImplContainer { def foo(x: Any) = macro Impls.foo diff --git a/test/pending/run/macro-reify-array/Macros_1.scala b/test/pending/run/macro-reify-array/Macros_1.scala index f970be5caa..eea0133feb 100644 --- a/test/pending/run/macro-reify-array/Macros_1.scala +++ b/test/pending/run/macro-reify-array/Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: String) = macro Impls.foo[T] object Impls { - def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { Array(s.splice) } } diff --git a/test/pending/run/macro-reify-tagful-b/Macros_1.scala b/test/pending/run/macro-reify-tagful-b/Macros_1.scala index 59dbe7157b..f4d8062a14 100644 --- a/test/pending/run/macro-reify-tagful-b/Macros_1.scala +++ b/test/pending/run/macro-reify-tagful-b/Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: T) = macro Impls.foo[List[T]] object Impls { - def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { List(s.splice) } } diff --git a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala index a581c47026..1307052394 100644 --- a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala +++ b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: T) = macro Impls.foo[List[T]] object Impls { - def foo[T](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { List(s.splice) } } diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala index 10487b1515..09ca6ba30e 100644 --- a/test/pending/run/macro-reify-tagless-b/Test_2.scala +++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala @@ -6,8 +6,8 @@ object Test extends App { import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) - val rhs = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant("hello world")))) - val list = ValDef(NoMods, newTermName("list"), tpt, rhs) - val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name)))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) println(cm.mkToolBox().eval(tree)) } diff --git a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala new file mode 100644 index 0000000000..c43f5f3f53 --- /dev/null +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +}
\ No newline at end of file diff --git a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala new file mode 100644 index 0000000000..dd2317b1b7 --- /dev/null +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala @@ -0,0 +1,6 @@ +import language.experimental.macros + +object Test extends App { + val macros = new { def foo = macro Impls.foo } + macros.foo +}
\ No newline at end of file diff --git a/test/pending/run/reify_callccinterpreter.scala b/test/pending/run/reify_callccinterpreter.scala index d9f7736769..82c70da28f 100644 --- a/test/pending/run/reify_callccinterpreter.scala +++ b/test/pending/run/reify_callccinterpreter.scala @@ -43,15 +43,15 @@ object Test extends App { override def toString() = "<function>" } - type Environment = List[Pair[Name, Value]]; + type Environment = List[Tuple2[Name, Value]]; def lookup(x: Name, e: Environment): M[Value] = e match { case List() => unitM(Wrong) - case Pair(y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) + case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) } - def add(a: Value, b: Value): M[Value] = Pair(a, b) match { - case Pair(Num(m), Num(n)) => unitM(Num(m + n)) + def add(a: Value, b: Value): M[Value] = (a, b) match { + case (Num(m), Num(n)) => unitM(Num(m + n)) case _ => unitM(Wrong) } @@ -67,12 +67,12 @@ object Test extends App { b <- interp(r, e); c <- add(a, b)) yield c - case Lam(x, t) => unitM(Fun(a => interp(t, Pair(x, a) :: e))) + case Lam(x, t) => unitM(Fun(a => interp(t, (x, a) :: e))) case App(f, t) => for (a <- interp(f, e); b <- interp(t, e); c <- apply(a, b)) yield c - case Ccc(x, t) => callCC(k => interp(t, Pair(x, Fun(k)) :: e)) + case Ccc(x, t) => callCC(k => interp(t, (x, Fun(k)) :: e)) } def test(t: Term): String = showM(interp(t, List())) diff --git a/test/pending/run/reify_implicits-new.check b/test/pending/run/reify_implicits-new.check deleted file mode 100644 index e3aeb20f6b..0000000000 --- a/test/pending/run/reify_implicits-new.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-new.scala b/test/pending/run/reify_implicits-new.scala deleted file mode 100644 index 42a1deef26..0000000000 --- a/test/pending/run/reify_implicits-new.scala +++ /dev/null @@ -1,16 +0,0 @@ -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/pending/run/reify_implicits-old.check b/test/pending/run/reify_implicits-old.check deleted file mode 100644 index e3aeb20f6b..0000000000 --- a/test/pending/run/reify_implicits-old.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-old.scala b/test/pending/run/reify_implicits-old.scala deleted file mode 100644 index 8ff256d2d4..0000000000 --- a/test/pending/run/reify_implicits-old.scala +++ /dev/null @@ -1,15 +0,0 @@ -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/pending/run/reify_simpleinterpreter.scala b/test/pending/run/reify_simpleinterpreter.scala index 6cf87ea7c5..1f6d6c8da7 100644 --- a/test/pending/run/reify_simpleinterpreter.scala +++ b/test/pending/run/reify_simpleinterpreter.scala @@ -32,15 +32,15 @@ object Test extends App { override def toString() = "<function>" } - type Environment = List[Pair[Name, Value]] + type Environment = List[Tuple2[Name, Value]] def lookup(x: Name, e: Environment): M[Value] = e match { case List() => unitM(Wrong) - case Pair(y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) + case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) } - def add(a: Value, b: Value): M[Value] = Pair(a, b) match { - case Pair(Num(m), Num(n)) => unitM(Num(m + n)) + def add(a: Value, b: Value): M[Value] = (a, b) match { + case (Num(m), Num(n)) => unitM(Num(m + n)) case _ => unitM(Wrong) } @@ -56,7 +56,7 @@ object Test extends App { b <- interp(r, e); c <- add(a, b)) yield c - case Lam(x, t) => unitM(Fun(a => interp(t, Pair(x, a) :: e))) + case Lam(x, t) => unitM(Fun(a => interp(t, (x, a) :: e))) case App(f, t) => for (a <- interp(f, e); b <- interp(t, e); c <- apply(a, b)) diff --git a/test/pending/run/t2318.check b/test/pending/run/t2318.check deleted file mode 100644 index a486f1ac47..0000000000 --- a/test/pending/run/t2318.check +++ /dev/null @@ -1,2 +0,0 @@ -bar -bar diff --git a/test/pending/run/t2318.scala b/test/pending/run/t2318.scala deleted file mode 100644 index e42cbb9680..0000000000 --- a/test/pending/run/t2318.scala +++ /dev/null @@ -1,38 +0,0 @@ -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/pending/run/t3897.check b/test/pending/run/t3897.check deleted file mode 100644 index 244b83716f..0000000000 --- a/test/pending/run/t3897.check +++ /dev/null @@ -1,8 +0,0 @@ -(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/pending/run/t3897/J_2.java b/test/pending/run/t3897/J_2.java deleted file mode 100644 index 178412dc92..0000000000 --- a/test/pending/run/t3897/J_2.java +++ /dev/null @@ -1,27 +0,0 @@ -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/pending/run/t3897/a_1.scala b/test/pending/run/t3897/a_1.scala deleted file mode 100644 index 4da959e2ac..0000000000 --- a/test/pending/run/t3897/a_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -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/pending/run/t3897/a_2.scala b/test/pending/run/t3897/a_2.scala deleted file mode 100644 index 4d9e59ef05..0000000000 --- a/test/pending/run/t3897/a_2.scala +++ /dev/null @@ -1,23 +0,0 @@ -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/pending/run/t4728.check b/test/pending/run/t4728.check deleted file mode 100644 index 7a754f414c..0000000000 --- a/test/pending/run/t4728.check +++ /dev/null @@ -1,2 +0,0 @@ -1 -2
\ No newline at end of file diff --git a/test/pending/run/t4728.scala b/test/pending/run/t4728.scala deleted file mode 100644 index 36f7860613..0000000000 --- a/test/pending/run/t4728.scala +++ /dev/null @@ -1,11 +0,0 @@ -class X -class Y extends X -object Ambiguous { - def f(x: X) = 1 - def f(ys: Y*) = 2 -} - -object Test extends App { - println(Ambiguous.f(new X)) - println(Ambiguous.f(new Y)) -}
\ No newline at end of file diff --git a/test/pending/run/t5293-map.scala b/test/pending/run/t5293-map.scala deleted file mode 100644 index 2707aed07e..0000000000 --- a/test/pending/run/t5293-map.scala +++ /dev/null @@ -1,88 +0,0 @@ - - - -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/pending/run/t5293.scala b/test/pending/run/t5293.scala deleted file mode 100644 index 01ead45d2a..0000000000 --- a/test/pending/run/t5293.scala +++ /dev/null @@ -1,83 +0,0 @@ - - - -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/pending/run/t5418.check b/test/pending/run/t5418.check deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/pending/run/t5418.check +++ /dev/null diff --git a/test/pending/run/t5418.scala b/test/pending/run/t5418.scala deleted file mode 100644 index e3cb20cf82..0000000000 --- a/test/pending/run/t5418.scala +++ /dev/null @@ -1,8 +0,0 @@ -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/pending/run/t5427a.scala b/test/pending/run/t5427a.scala index f7cd05158d..a7d20922db 100644 --- a/test/pending/run/t5427a.scala +++ b/test/pending/run/t5427a.scala @@ -4,7 +4,7 @@ object Foo { val bar = 2 } object Test extends App { val tpe = getType(Foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(Foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5427b.scala b/test/pending/run/t5427b.scala index e80bd12369..af1ae6ea2f 100644 --- a/test/pending/run/t5427b.scala +++ b/test/pending/run/t5427b.scala @@ -5,7 +5,7 @@ class Foo { val bar = 2 } object Test extends App { val foo = new Foo val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5427c.scala b/test/pending/run/t5427c.scala index 7095158e85..ba71803080 100644 --- a/test/pending/run/t5427c.scala +++ b/test/pending/run/t5427c.scala @@ -5,7 +5,7 @@ class Foo(bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) bar match { case NoSymbol => println("no public member") case _ => println("i'm screwed") diff --git a/test/pending/run/t5427d.scala b/test/pending/run/t5427d.scala index f0cc07d27e..1d37dbdde3 100644 --- a/test/pending/run/t5427d.scala +++ b/test/pending/run/t5427d.scala @@ -5,7 +5,7 @@ class Foo(val bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5610a.check b/test/pending/run/t5610a.check deleted file mode 100644 index 2aa46b3b91..0000000000 --- a/test/pending/run/t5610a.check +++ /dev/null @@ -1 +0,0 @@ -Stroke a kitten diff --git a/test/pending/run/t5610a.scala b/test/pending/run/t5610a.scala deleted file mode 100644 index f20b295762..0000000000 --- a/test/pending/run/t5610a.scala +++ /dev/null @@ -1,19 +0,0 @@ -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 diff --git a/test/pending/run/t5866b.scala b/test/pending/run/t5866b.scala new file mode 100644 index 0000000000..44d8b114b8 --- /dev/null +++ b/test/pending/run/t5866b.scala @@ -0,0 +1,17 @@ +class Foo(val d: Double) extends AnyVal { + override def toString = s"Foo($d)" +} + +class Bar(val d: String) extends AnyVal { + override def toString = s"Foo($d)" +} + +object Test { + def main(args: Array[String]): Unit = { + val f: Foo = {val n: Any = null; n.asInstanceOf[Foo]} + println(f) + + val b: Bar = {val n: Any = null; n.asInstanceOf[Bar]} + println(b) + } +} diff --git a/test/pending/run/t5943b1.scala b/test/pending/run/t5943b1.scala index 0d54718753..79c638fedc 100644 --- a/test/pending/run/t5943b1.scala +++ b/test/pending/run/t5943b1.scala @@ -6,5 +6,5 @@ import scala.tools.reflect.ToolBox object Test extends App { val tb = cm.mkToolBox() val expr = tb.parse("math.sqrt(4.0)") - println(tb.typeCheck(expr)) + println(tb.typecheck(expr)) }
\ No newline at end of file diff --git a/test/pending/run/t7733.check b/test/pending/run/t7733.check new file mode 100644 index 0000000000..19765bd501 --- /dev/null +++ b/test/pending/run/t7733.check @@ -0,0 +1 @@ +null diff --git a/test/pending/run/t7733/Separate_1.scala b/test/pending/run/t7733/Separate_1.scala new file mode 100644 index 0000000000..a326ecd53e --- /dev/null +++ b/test/pending/run/t7733/Separate_1.scala @@ -0,0 +1,5 @@ +package test + +class Separate { + for (i <- 1 to 10) println(i) +}
\ No newline at end of file diff --git a/test/pending/run/t7733/Test_2.scala b/test/pending/run/t7733/Test_2.scala new file mode 100644 index 0000000000..28358574ec --- /dev/null +++ b/test/pending/run/t7733/Test_2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + val tb = cm.mkToolBox() + val code = tb.parse("{ val x: test.Separate$$anonfun$1 = null; x }") + println(tb.eval(code)) +}
\ No newline at end of file diff --git a/test/pending/run/virtpatmat_anonfun_underscore.check b/test/pending/run/virtpatmat_anonfun_underscore.check deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/pending/run/virtpatmat_anonfun_underscore.check +++ /dev/null |