diff options
Diffstat (limited to 'test/pending/run')
168 files changed, 0 insertions, 2395 deletions
diff --git a/test/pending/run/TestFlatMap.scala b/test/pending/run/TestFlatMap.scala deleted file mode 100644 index dd5a0a0c2f..0000000000 --- a/test/pending/run/TestFlatMap.scala +++ /dev/null @@ -1,29 +0,0 @@ -import scala.collection.parallel.{ ParMap => PMap } -import scala.collection.parallel.mutable.{ ParHashSet => PMHashSet, ParHashMap => PMHashMap, ParArray } -import scala.util.Random -import scala.collection.parallel.CompositeThrowable - -object Test { - - def main(args: Array[String]) { - val N = 1500 - val M = 1500 - var unmatchedLeft = new PMHashSet[Int] - var unmatchedRight = new PMHashSet[Int] - Range(0, N).foreach{ x => unmatchedLeft += x} - Range(0, M).foreach{ x => unmatchedRight += x} - - try { - val matches = unmatchedLeft.flatMap{ lind: Int => - val dists = unmatchedRight.seq.map{ rind: Int => - val dist = Random.nextInt - (rind, dist) - } - dists - } - } catch { - case c: CompositeThrowable => for (t <- c.throwables) println("\n%s\n%s".format(t, t.getStackTrace.mkString("\n"))) - } - } - -} diff --git a/test/pending/run/bug4704run.scala b/test/pending/run/bug4704run.scala deleted file mode 100644 index af488a56c7..0000000000 --- a/test/pending/run/bug4704run.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait MM { - protected def method = "bip" -} -trait NN { - protected def method = "bop" -} -trait OOOOO extends MM with NN { - override protected def method = super[MM].method + super[NN].method - override def hashCode = super[MM].hashCode + super[NN].hashCode -} diff --git a/test/pending/run/delambdafy-lambdametafactory.scala b/test/pending/run/delambdafy-lambdametafactory.scala deleted file mode 100644 index daea8a39fe..0000000000 --- a/test/pending/run/delambdafy-lambdametafactory.scala +++ /dev/null @@ -1,50 +0,0 @@ -// -// Tests that the static accessor method for lambda bodies -// (generated under -Ydelambdafy:method) are compatible with -// Java 8's LambdaMetafactory. -// -import java.lang.invoke._ - -class C { - def test1: Unit = { - (x: String) => x.reverse - } - def test2: Unit = { - val capture1 = "capture1" - (x: String) => capture1 + " " + x.reverse - } - def test3: Unit = { - (x: String) => C.this + " " + x.reverse - } -} -trait T { - def test4: Unit = { - (x: String) => x.reverse - } -} - -// A functional interface. Function1 contains abstract methods that are filled in by mixin -trait Function1ish[A, B] { - def apply(a: A): B -} - -object Test { - def lambdaFactory[A, B](hostClass: Class[_], instantiatedParam: Class[A], instantiatedRet: Class[B], accessorName: String, - capturedParams: Array[(Class[_], AnyRef)] = Array()) = { - val caller = MethodHandles.lookup - val methodType = MethodType.methodType(classOf[AnyRef], Array[Class[_]](classOf[AnyRef])) - val instantiatedMethodType = MethodType.methodType(instantiatedRet, Array[Class[_]](instantiatedParam)) - val (capturedParamTypes, captured) = capturedParams.unzip - val targetMethodType = MethodType.methodType(instantiatedRet, capturedParamTypes :+ instantiatedParam) - val invokedType = MethodType.methodType(classOf[Function1ish[_, _]], capturedParamTypes) - val target = caller.findStatic(hostClass, accessorName, targetMethodType) - val site = LambdaMetafactory.metafactory(caller, "apply", invokedType, methodType, target, instantiatedMethodType) - site.getTarget.invokeWithArguments(captured: _*).asInstanceOf[Function1ish[A, B]] - } - def main(args: Array[String]) { - println(lambdaFactory(classOf[C], classOf[String], classOf[String], "accessor$1").apply("abc")) - println(lambdaFactory(classOf[C], classOf[String], classOf[String], "accessor$2", Array(classOf[String] -> "capture1")).apply("abc")) - println(lambdaFactory(classOf[C], classOf[String], classOf[String], "accessor$3", Array(classOf[C] -> new C)).apply("abc")) - println(lambdaFactory(Class.forName("T$class"), classOf[String], classOf[String], "accessor$4", Array(classOf[T] -> new T{})).apply("abc")) - } -} diff --git a/test/pending/run/hk-lub-fail.scala b/test/pending/run/hk-lub-fail.scala deleted file mode 100644 index 0ac4fdd841..0000000000 --- a/test/pending/run/hk-lub-fail.scala +++ /dev/null @@ -1,37 +0,0 @@ -// Tue Jul 12 16:38:23 PDT 2011 - -class Bip[T1] -class Foo[T2] extends Bip[T2] -class Bar[T3] extends Bip[T3] - -abstract class Factory[CC[X] <: Bip[X]] { } - -object Quux1 extends Factory[Foo] -object Quux2 extends Factory[Bar] - -object Test { - // FAIL - val xs = List(Quux1, Quux2) - // error: type mismatch; - // found : Quux1.type (with underlying type object Quux1) - // required: Factory[_ >: Bar with Foo <: Bip] - // ^^ ^^ ^^ ^^ <-- QUIZ: what is missing from these types? - - // The type it should figure out, come on scalac - type F = Factory[CC] forSome { type X ; type CC[X] >: Bar[X] with Foo[X] <: Bip[X] } - - // No problem - val ys = List[F](Quux1, Quux2) - - // A repl session to get you started. -/* - 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(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 deleted file mode 100644 index c9d650ca89..0000000000 --- a/test/pending/run/idempotency-partial-functions.scala +++ /dev/null @@ -1,28 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.{ToolBox, ToolBoxError} -import scala.tools.reflect.Eval - -// Related to SI-6187 -// -// Moved to pending as we are currently blocked by the inability -// to reify the parent types of the anonymous function class, -// which are not part of the tree, but rather only part of the -// ClassInfoType. -object Test extends App { - val partials = reify { - List((false,true)) collect { case (x,true) => x } - } - println(Seq(show(partials), showRaw(partials)).mkString("\n\n")) - try { - println(partials.eval) - } catch { - case e: ToolBoxError => println(e) - } - val tb = cm.mkToolBox() - val tpartials = tb.typecheck(partials.tree) - println(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/implicit-classes.scala b/test/pending/run/implicit-classes.scala deleted file mode 100644 index 02b74de2b0..0000000000 --- a/test/pending/run/implicit-classes.scala +++ /dev/null @@ -1,17 +0,0 @@ -object O { - implicit class C(s: String) { - def twice = s + s - } -} - -/** -// -// We'd like to augment object O in Namers so that it also has an implicit method -object O { - implicit class C(s: String) { - def twice = s + s - } - implicit def C(s: String): C = new C(s) -} - -**/ diff --git a/test/pending/run/instanceOfAndTypeMatching.scala b/test/pending/run/instanceOfAndTypeMatching.scala deleted file mode 100644 index e04ae13585..0000000000 --- a/test/pending/run/instanceOfAndTypeMatching.scala +++ /dev/null @@ -1,192 +0,0 @@ -// Summary of incorrect or questionable behavior. -// Full code and successful parts follow. - -object Summary { - class Outer { - class Inner { } - def f() = { class MethodInner ; new MethodInner } - } - - // 1 static issue: - // - // Given method in MethodInner: def g(other: MethodInner) = () - // method1.g(method1) fails to compile with type error. - // - // Note that this cannot be worked around by widening the return type - // of f() because MethodInner is declared inside of f. So there is no way - // I see for a class declared inside a method to receive members of its - // own declared type -- not only the narrow type of those from this - // instance, but ANY members, because there is no Foo#Bar syntax which will - // traverse a method. - // - // 4 runtime issues: - // - // From the outside: inner1.isInstanceOf[outer2.Inner] is true, should (maybe) be false - // From inside inner1: inner2.isInstanceOf[Outer.this.Inner] is true, should (maybe) be false - // From the outside: inner1 match { case _: outer2.Inner => true ... } is true, should definitely be false - // From inside method1: method2 match { case _: MethodInner => true ... } is true, should definitely be false - // - // Note that the fact that every test returns true on instances of MethodInner means - // that it is impossible to draw any type distinction between instances. As far as one - // can tell, they are all of the same type regardless not only of whether they were - // created on the same method invocation but whether they are contained in the same - // instance of Outer. - // - // WRT "same method invocation", see Iterator.duplicate for an example of this. -} - -// Tests - -class Outer { - class Inner { - def passOuter(other: Outer) = () // pass any Outer - def passThisType(other: Outer.this.type) = () // pass only this Outer instance - def passInner(other: Inner) = () // pass only Inners from this Outer instance - def passInner2(other: Outer.this.Inner) = () // same as above - def passInnerSharp(other: Outer#Inner) = () // pass any Inner - - def compareSimpleWithTypeMatch(other: Any) = other match { - case _: Inner => true - case _ => false - } - def compareSimpleWithInstanceOf(other: Any) = other.isInstanceOf[Inner] - - def compareSharpWithTypeMatch(other: Any) = { - other match { - case _: Outer#Inner => true - case _ => false - } - } - def compareSharpWithInstanceOf(other: Any) = other.isInstanceOf[Outer#Inner] - - def comparePathWithTypeMatch(other: Any) = other match { - case _: Outer.this.Inner => true - case _ => false - } - def comparePathWithInstanceOf(other: Any) = other.isInstanceOf[Outer.this.Inner] - } - - def f() = { - class MethodInner { - def passOuter(other: Outer) = () // pass any Outer - def passThisType(other: Outer.this.type) = () // pass only this Outer instance - def passInner(other: Inner) = () // pass only Inners from this Outer instance - def passInner2(other: Outer.this.Inner) = () // same as above - def passInnerSharp(other: Outer#Inner) = () // pass any Inner - def passMethodInner(other: MethodInner) = () // pass only MethodInners from this Outer instance - // is there any way to refer to Outer#MethodInner? Not that there should be. - - def compareWithInstanceOf(other: Any) = other.isInstanceOf[MethodInner] - def compareWithTypeMatch(other: Any) = other match { - case _: MethodInner => true - case _ => false - } - } - - new MethodInner - } -} - -object Test { - val outer1 = new Outer - val outer2 = new Outer - val inner1 = new outer1.Inner - val inner2 = new outer2.Inner - val method1 = outer1.f() - val method2 = outer2.f() - - def testInnerStatic = { - // these should all work - inner1.passOuter(outer1) - inner1.passOuter(outer2) - inner1.passThisType(outer1) - inner1.passInner(inner1) - inner1.passInner2(inner1) - inner1.passInnerSharp(inner1) - inner1.passInnerSharp(inner2) - - // these should all fail to compile, and do - // - // inner1.passThisType(outer2) - // inner1.passInner(inner2) - // inner1.passInner2(inner2) - } - def testInnerRuntime = { - println("testInnerRuntime\n") - - List("These should be true under any scenario: ", - inner1.isInstanceOf[outer1.Inner] , - inner1.isInstanceOf[Outer#Inner] , - (inner1: Any) match { case _: Outer#Inner => true ; case _ => false } , - (inner1: Any) match { case _: outer1.Inner => true ; case _ => false } , - inner1.compareSharpWithTypeMatch(inner2) , - inner1.compareSharpWithInstanceOf(inner2) - ) foreach println - - List("These should be true under current proposal: ", - inner1.compareSimpleWithInstanceOf(inner2) - ) foreach println - - List("These should be false under current proposal: ", - inner1.compareSimpleWithTypeMatch(inner2) , - inner1.comparePathWithTypeMatch(inner2) - ) foreach println - - List("These return true but I think should return false: ", - inner1.isInstanceOf[outer2.Inner] , // true - inner1.comparePathWithInstanceOf(inner2) // true - ) foreach println - - List("These are doing the wrong thing under current proposal", - (inner1: Any) match { case _: outer2.Inner => true ; case _ => false } // should be false - ) foreach println - } - - def testMethodInnerStatic = { - // these should all work - method1.passOuter(outer1) - method1.passOuter(outer2) - method1.passThisType(outer1) - method1.passInner(inner1) - method1.passInner2(inner1) - method1.passInnerSharp(inner1) - method1.passInnerSharp(inner2) - // This fails with: - // - // a.scala:114: error: type mismatch; - // found : Test.method1.type (with underlying type MethodInner forSome { type MethodInner <: java.lang.Object with ScalaObject{def passOuter(other: Outer): Unit; def passThisType(other: Test.outer1.type): Unit; def passInner(other: Test.outer1.Inner): Unit; def passInner2(other: Test.outer1.Inner): Unit; def passInnerSharp(other: Outer#Inner): Unit; def passMethodInner(other: MethodInner): Unit} }) - // required: MethodInner where type MethodInner <: java.lang.Object with ScalaObject{def passOuter(other: Outer): Unit; def passThisType(other: Test.outer1.type): Unit; def passInner(other: Test.outer1.Inner): Unit; def passInner2(other: Test.outer1.Inner): Unit; def passInnerSharp(other: Outer#Inner): Unit; def passMethodInner(other: MethodInner): Unit} - // method1.passMethodInner(method1) - // ^ - method1.passMethodInner(method1) - - // these should all fail to compile, and do - // - // method1.passThisType(outer2) - // method1.passInner(inner2) - // method1.passInner2(inner2) - // method1.passMethodInner(method2) - } - - def testMethodInnerRuntime = { - println("\ntestMethodInnerRuntime\n") - - List("These should be true under any scenario: ", - method1.compareWithInstanceOf(method1) , - method1.compareWithTypeMatch(method1) - ) foreach println - - List("These should be true under current proposal: ", - method1.compareWithInstanceOf(method2) - ) foreach println - - List("These are doing the wrong thing under current proposal", - method1.compareWithTypeMatch(method2) // should be false - ) foreach println - } - - def main(args: Array[String]): Unit = { - testInnerRuntime - testMethodInnerRuntime - } -} diff --git a/test/pending/run/jar-version.scala b/test/pending/run/jar-version.scala deleted file mode 100644 index b79dfe733d..0000000000 --- a/test/pending/run/jar-version.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.util.Properties._ -import scala.tools.nsc.util.ClassPath._ - -object Test { - def main(args: Array[String]): Unit = { - infoFor(this).jarManifestMainAttrs get ScalaCompilerVersion match { - case Some(v) => println("I was built by scala compiler version " + v) - case _ => println("I was not apprised of which scala compiler version built me.") - } - } -} diff --git a/test/pending/run/macro-expand-default.flags b/test/pending/run/macro-expand-default.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-default.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index fd5d8d7f18..0000000000 --- a/test/pending/run/macro-expand-default/Impls_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = { - import c.universe._ - 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-default/Macros_Test_2.scala b/test/pending/run/macro-expand-default/Macros_Test_2.scala deleted file mode 100644 index 92fe84d04a..0000000000 --- a/test/pending/run/macro-expand-default/Macros_Test_2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test extends App { - def foo(x: Int = 2, y: Int = -40) = macro Impls.foo - foo(y = -40, x = 2) - foo(x = 2, y = -40) - foo(x = 100) - foo(y = 100) - foo() -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.check b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.check deleted file mode 100644 index e7cb9c367b..0000000000 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.check +++ /dev/null @@ -1,6 +0,0 @@ -openImplicits are: List() -enclosingImplicits are: List((List[Int],scala.this.Predef.implicitly[List[Int]])) -typetag is: TypeTag[Nothing] -openImplicits are: List() -enclosingImplicits are: List((List[String],Test.this.bar[String])) -typetag is: TypeTag[Nothing] diff --git a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.flags b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index e8170fda07..0000000000 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.whitebox.Context - -object Impls { - def foo[T: c.WeakTypeTag](c: Context): c.Expr[List[T]] = c.universe.reify { - println("openImplicits are: " + c.literal(c.openImplicits.toString).splice) - println("enclosingImplicits are: " + c.literal(c.enclosingImplicits.toString).splice) - println("typetag is: " + c.literal(c.tag[T].toString).splice) - null - } -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Macros_Test_2.scala b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Macros_Test_2.scala deleted file mode 100644 index 27d0662799..0000000000 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Macros_Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends App { - implicit def foo[T]: List[T] = macro Impls.foo[T] - def bar[T](implicit foo: List[T]) {} - implicitly[List[Int]] - bar[String] -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-macro-has-context-bound.check b/test/pending/run/macro-expand-macro-has-context-bound.check deleted file mode 100644 index ac4213d6e9..0000000000 --- a/test/pending/run/macro-expand-macro-has-context-bound.check +++ /dev/null @@ -1 +0,0 @@ -43
\ No newline at end of file diff --git a/test/pending/run/macro-expand-macro-has-context-bound.flags b/test/pending/run/macro-expand-macro-has-context-bound.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-macro-has-context-bound.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file 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 deleted file mode 100644 index 34182b7968..0000000000 --- a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo[U](c: Context)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { - import c.universe._ - 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-macro-has-context-bound/Macros_Test_2.scala b/test/pending/run/macro-expand-macro-has-context-bound/Macros_Test_2.scala deleted file mode 100644 index 7d16b773a6..0000000000 --- a/test/pending/run/macro-expand-macro-has-context-bound/Macros_Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - def foo[U: Numeric](x: U) = macro Impls.foo[U] - foo(42) -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-named.flags b/test/pending/run/macro-expand-named.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-named.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index fd5d8d7f18..0000000000 --- a/test/pending/run/macro-expand-named/Impls_1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - def foo(c: Context)(x: c.Expr[Int], y: c.Expr[Int]) = { - import c.universe._ - 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-named/Macros_Test_2.scala b/test/pending/run/macro-expand-named/Macros_Test_2.scala deleted file mode 100644 index abebcf8448..0000000000 --- a/test/pending/run/macro-expand-named/Macros_Test_2.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test extends App { - def foo(x: Int, y: Int) = macro Impls.foo - foo(y = -40, x = 2) - foo(x = 2, y = -40) -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-e1.check b/test/pending/run/macro-expand-tparams-prefix-e1.check deleted file mode 100644 index 4fa05a7678..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-e1.check +++ /dev/null @@ -1,3 +0,0 @@ -TypeTag(List[Int]) -TypeTag(String) -TypeTag(Boolean) diff --git a/test/pending/run/macro-expand-tparams-prefix-e1.flags b/test/pending/run/macro-expand-tparams-prefix-e1.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-e1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index 683622b29d..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - 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), 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-e1/Macros_Test_2.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala deleted file mode 100644 index d4fc52fca0..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-e1/Macros_Test_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - class D[T: TypeTag] { - class C[U: TypeTag] { - def foo[V] = macro Impls.foo[List[T], U, V] - foo[Boolean] - } - } - - val outer1 = new D[Int] - new outer1.C[String] -}
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-f1.check b/test/pending/run/macro-expand-tparams-prefix-f1.check deleted file mode 100644 index d15226143a..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-f1.check +++ /dev/null @@ -1,3 +0,0 @@ -TypeTag(List[T]) -TypeTag(U) -TypeTag(Boolean) diff --git a/test/pending/run/macro-expand-tparams-prefix-f1.flags b/test/pending/run/macro-expand-tparams-prefix-f1.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-f1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index 683622b29d..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Impls { - 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), 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/Macros_Test_2.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala deleted file mode 100644 index 9417cf663e..0000000000 --- a/test/pending/run/macro-expand-tparams-prefix-f1/Macros_Test_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - class D[T] { - class C[U] { - def foo[V] = macro Impls.foo[List[T], U, V] - foo[Boolean] - } - } - - val outer1 = new D[Int] - new outer1.C[String] -}
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-a.check b/test/pending/run/macro-quasiinvalidbody-a.check deleted file mode 100644 index f70d7bba4a..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-a.check +++ /dev/null @@ -1 +0,0 @@ -42
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-a.flags b/test/pending/run/macro-quasiinvalidbody-a.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ 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 deleted file mode 100644 index 741a921b72..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -trait Impls { - 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 deleted file mode 100644 index 2735321eae..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros extends Impls { - def foo(x: Any) = macro impl -} - -object Test extends App { - import Macros._ - println(foo(42)) -}
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-b.check b/test/pending/run/macro-quasiinvalidbody-b.check deleted file mode 100644 index f70d7bba4a..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-b.check +++ /dev/null @@ -1 +0,0 @@ -42
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-b.flags b/test/pending/run/macro-quasiinvalidbody-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala deleted file mode 100644 index b023d31f05..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -trait ImplContainer { - object Impls { - 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 deleted file mode 100644 index 639d93fb5f..0000000000 --- a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros extends ImplContainer { - def foo(x: Any) = macro Impls.foo -} - -object Test extends App { - import Macros._ - println(foo(42)) -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-array.flags b/test/pending/run/macro-reify-array.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-reify-array.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/pending/run/macro-reify-array/Macros_1.scala b/test/pending/run/macro-reify-array/Macros_1.scala deleted file mode 100644 index eea0133feb..0000000000 --- a/test/pending/run/macro-reify-array/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -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: Context)(s: c.Expr[T]) = c.universe.reify { - Array(s.splice) - } - } -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-array/Test_2.scala b/test/pending/run/macro-reify-array/Test_2.scala deleted file mode 100644 index e40d5b40e0..0000000000 --- a/test/pending/run/macro-reify-array/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val arr = Macros.foo("hello", "world") - println(arr.getClass) -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check deleted file mode 100644 index 7e4b000c52..0000000000 --- a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags.check +++ /dev/null @@ -1,2 +0,0 @@ -TypeTag(List[Int]) -TypeTag(List[List[Int]]) diff --git a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala b/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala deleted file mode 100644 index 3252423375..0000000000 --- a/test/pending/run/macro-reify-groundtypetag-hktypeparams-tags/Test.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - def fooTypeTagHK[C[_]: TypeTag, T: TypeTag] = { - println(implicitly[TypeTag[C[T]]]) - println(implicitly[TypeTag[List[C[T]]]]) - } - fooTypeTagHK[List, Int] -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagful-b.check b/test/pending/run/macro-reify-tagful-b.check deleted file mode 100644 index 5bd9fe2156..0000000000 --- a/test/pending/run/macro-reify-tagful-b.check +++ /dev/null @@ -1 +0,0 @@ -List(List(hello world)) diff --git a/test/pending/run/macro-reify-tagful-b.flags b/test/pending/run/macro-reify-tagful-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-reify-tagful-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagful-b/Macros_1.scala b/test/pending/run/macro-reify-tagful-b/Macros_1.scala deleted file mode 100644 index f4d8062a14..0000000000 --- a/test/pending/run/macro-reify-tagful-b/Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -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: Context)(s: c.Expr[T]) = c.universe.reify { - List(s.splice) - } - } -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagful-b/Test_2.scala b/test/pending/run/macro-reify-tagful-b/Test_2.scala deleted file mode 100644 index 142234901f..0000000000 --- a/test/pending/run/macro-reify-tagful-b/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val list: List[List[String]] = Macros.foo(List("hello world")) - println(list) -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagless-b.check b/test/pending/run/macro-reify-tagless-b.check deleted file mode 100644 index 61ebb4e547..0000000000 --- a/test/pending/run/macro-reify-tagless-b.check +++ /dev/null @@ -1,3 +0,0 @@ -error: macro must not return an expr that contains free type variables (namely: T). have you forgot to use c.TypeTag annotations for type parameters external to a reifee? - -java.lang.Error: reflective compilation has failed diff --git a/test/pending/run/macro-reify-tagless-b.flags b/test/pending/run/macro-reify-tagless-b.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/macro-reify-tagless-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file 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 deleted file mode 100644 index 1307052394..0000000000 --- a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.macros.blackbox.Context - -object Macros { - def foo[T](s: T) = macro Impls.foo[List[T]] - - object Impls { - def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { - List(s.splice) - } - } -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala deleted file mode 100644 index 09ca6ba30e..0000000000 --- a/test/pending/run/macro-reify-tagless-b/Test_2.scala +++ /dev/null @@ -1,13 +0,0 @@ -object Test extends App { - //val list: List[String] = Macros.foo("hello world") - //println(list) - - import scala.reflect.runtime.universe._ - 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(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-reify-typetag-hktypeparams-notags.check b/test/pending/run/macro-reify-typetag-hktypeparams-notags.check deleted file mode 100644 index 53acc9184c..0000000000 --- a/test/pending/run/macro-reify-typetag-hktypeparams-notags.check +++ /dev/null @@ -1,2 +0,0 @@ -TypeTag(C[T]) -TypeTag(List[C[T]]) diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala b/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala deleted file mode 100644 index c7b1cedcd2..0000000000 --- a/test/pending/run/macro-reify-typetag-hktypeparams-notags/Test.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - def fooNoTypeTagHK[C[_], T] = { - println(implicitly[TypeTag[C[T]]]) - println(implicitly[TypeTag[List[C[T]]]]) - } - fooNoTypeTagHK[List, Int] -}
\ No newline at end of file diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-tags.check b/test/pending/run/macro-reify-typetag-hktypeparams-tags.check deleted file mode 100644 index 7e4b000c52..0000000000 --- a/test/pending/run/macro-reify-typetag-hktypeparams-tags.check +++ /dev/null @@ -1,2 +0,0 @@ -TypeTag(List[Int]) -TypeTag(List[List[Int]]) diff --git a/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala b/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala deleted file mode 100644 index 3252423375..0000000000 --- a/test/pending/run/macro-reify-typetag-hktypeparams-tags/Test.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - def fooTypeTagHK[C[_]: TypeTag, T: TypeTag] = { - println(implicitly[TypeTag[C[T]]]) - println(implicitly[TypeTag[List[C[T]]]]) - } - fooTypeTagHK[List, Int] -}
\ No newline at end of file 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 deleted file mode 100644 index c43f5f3f53..0000000000 --- a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index dd2317b1b7..0000000000 --- a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -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/partial-anyref-spec.check b/test/pending/run/partial-anyref-spec.check deleted file mode 100644 index 26e41933e7..0000000000 --- a/test/pending/run/partial-anyref-spec.check +++ /dev/null @@ -1,13 +0,0 @@ -Fn$mcII$sp -Fn$mcLI$sp -Fn$mcLI$sp -Fn$mcIL$sp -Fn -Fn -Fn$mcIL$sp -Fn -Fn -Fn3 -Fn3$mcLIDF$sp -Fn3$mcBIDF$sp -Fn3 diff --git a/test/pending/run/partial-anyref-spec.scala b/test/pending/run/partial-anyref-spec.scala deleted file mode 100644 index 49ed514f03..0000000000 --- a/test/pending/run/partial-anyref-spec.scala +++ /dev/null @@ -1,31 +0,0 @@ -class Fn[@specialized(Int, AnyRef) -T, @specialized(Int, AnyRef) +R] { - override def toString = getClass.getName -} - -class Fn3[ - @specialized(Int, AnyRef) -T1, - @specialized(Double, AnyRef) -T2, - @specialized(Float) -T3, - @specialized(Byte, AnyRef) +R -] { - override def toString = getClass.getName -} - -object Test { - def main(args: Array[String]): Unit = { - println(new Fn[Int, Int]) - println(new Fn[Int, Byte]) - println(new Fn[Int, AnyRef]) - println(new Fn[Byte, Int]) - println(new Fn[Byte, Byte]) - println(new Fn[Byte, AnyRef]) - println(new Fn[AnyRef, Int]) - println(new Fn[AnyRef, Byte]) - println(new Fn[AnyRef, AnyRef]) - - println(new Fn3[Int, Int, Int, Int]) - println(new Fn3[Int, Double, Float, Int]) - println(new Fn3[Int, Double, Float, Byte]) - println(new Fn3[AnyRef, Double, AnyRef, Int]) - } -} diff --git a/test/pending/run/reflection-mem-eval.scala b/test/pending/run/reflection-mem-eval.scala deleted file mode 100644 index 9045c44cd6..0000000000 --- a/test/pending/run/reflection-mem-eval.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.tools.partest.MemoryTest - -trait A { type T <: A } -trait B { type T <: B } - -object Test extends MemoryTest { - lazy val tb = { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - cm.mkToolBox() - } - - override def maxDelta = 10 - override def calcsPerIter = 3 - override def calc() { - var snippet = """ - trait A { type T <: A } - trait B { type T <: B } - def foo[T](x: List[T]) = x - foo(List(new A {}, new B {})) - """.trim - snippet = snippet + "\n" + (List.fill(50)(snippet.split("\n").last) mkString "\n") - tb.eval(tb.parse(snippet)) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_addressbook.check b/test/pending/run/reify_addressbook.check deleted file mode 100644 index 4e12f87bdc..0000000000 --- a/test/pending/run/reify_addressbook.check +++ /dev/null @@ -1,30 +0,0 @@ -<html> - <head> - <title> - My Address Book - </title> - <style type="text/css"> table { border-right: 1px solid #cccccc; } - th { background-color: #cccccc; } - td { border-left: 1px solid #acacac; } - td { border-bottom: 1px solid #acacac; - </style> - </head> - <body> - <table cellspacing="0" cellpadding="2"> - <tr> - <th>Name</th> - <th>Age</th> - </tr> - <tr> - <td> Tom </td> - <td> 20 </td> - </tr><tr> - <td> Bob </td> - <td> 22 </td> - </tr><tr> - <td> James </td> - <td> 19 </td> - </tr> - </table> - </body> - </html> diff --git a/test/pending/run/reify_addressbook.scala b/test/pending/run/reify_addressbook.scala deleted file mode 100644 index d53a0f7bc0..0000000000 --- a/test/pending/run/reify_addressbook.scala +++ /dev/null @@ -1,65 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - case class Person(name: String, age: Int) - - /** An AddressBook takes a variable number of arguments - * which are accessed as a Sequence - */ - class AddressBook(a: Person*) { - private val people: List[Person] = a.toList - - /** Serialize to XHTML. Scala supports XML literals - * which may contain Scala expressions between braces, - * which are replaced by their evaluation - */ - def toXHTML = - <table cellpadding="2" cellspacing="0"> - <tr> - <th>Name</th> - <th>Age</th> - </tr> - { for (p <- people) yield - <tr> - <td> { p.name } </td> - <td> { p.age.toString() } </td> - </tr> - } - </table>; - } - - /** We introduce CSS using raw strings (between triple - * quotes). Raw strings may contain newlines and special - * characters (like \) are not interpreted. - */ - val header = - <head> - <title> - { "My Address Book" } - </title> - <style type="text/css"> { - """table { border-right: 1px solid #cccccc; } - th { background-color: #cccccc; } - td { border-left: 1px solid #acacac; } - td { border-bottom: 1px solid #acacac;"""} - </style> - </head>; - - val people = new AddressBook( - Person("Tom", 20), - Person("Bob", 22), - Person("James", 19)); - - val page = - <html> - { header } - <body> - { people.toXHTML } - </body> - </html>; - - println(page) - }.eval -} diff --git a/test/pending/run/reify_brainf_ck.check b/test/pending/run/reify_brainf_ck.check deleted file mode 100644 index 702bb18394..0000000000 --- a/test/pending/run/reify_brainf_ck.check +++ /dev/null @@ -1,4 +0,0 @@ ----running--- -Hello World! - ----done--- diff --git a/test/pending/run/reify_brainf_ck.scala b/test/pending/run/reify_brainf_ck.scala deleted file mode 100644 index 2af3bca1c7..0000000000 --- a/test/pending/run/reify_brainf_ck.scala +++ /dev/null @@ -1,79 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - import scala.annotation._ - - trait Func[T] { - val zero: T - def inc(t: T): T - def dec(t: T): T - def in: T - def out(t: T): Unit - } - - object ByteFunc extends Func[Byte] { - override val zero: Byte = 0 - override def inc(t: Byte) = ((t + 1) & 0xFF).toByte - override def dec(t: Byte) = ((t - 1) & 0xFF).toByte - override def in: Byte = readByte - override def out(t: Byte) { print(t.toChar) } - } - - case class Tape[T](left: List[T], cell: T, right: List[T])(implicit func: Func[T]) { - private def headOf(list:List[T]) = if (list.isEmpty) func.zero else list.head - private def tailOf(list:List[T]) = if (list.isEmpty) Nil else list.tail - def isZero = cell == func.zero - def execute(ch: Char) = (ch: @switch) match { - case '+' => copy(cell = func.inc(cell)) - case '-' => copy(cell = func.dec(cell)) - case '<' => Tape(tailOf(left), headOf(left), cell :: right) - case '>' => Tape(cell :: left, headOf(right), tailOf(right)) - case '.' => func.out(cell); this - case ',' => copy(cell = func.in) - case '[' | ']' => this - case _ => error("Unexpected token: " + ch) - } - } - - object Tape { - def empty[T](func: Func[T]) = Tape(Nil, func.zero, Nil)(func) - } - - class Brainfuck[T](func:Func[T]) { - - def execute(p: String) { - val prog = p.replaceAll("[^\\+\\-\\[\\]\\.\\,\\>\\<]", "") - - @tailrec def braceMatcher(pos: Int, stack: List[Int], o2c: Map[Int, Int]): Map[Int,Int] = - if(pos == prog.length) o2c else (prog(pos): @switch) match { - case '[' => braceMatcher(pos + 1, pos :: stack, o2c) - case ']' => braceMatcher(pos + 1, stack.tail, o2c + (stack.head -> pos)) - case _ => braceMatcher(pos + 1, stack, o2c) - } - - val open2close = braceMatcher(0, Nil, Map()) - val close2open = open2close.map(_.swap) - - @tailrec def ex(pos:Int, tape:Tape[T]): Unit = - if(pos < prog.length) ex((prog(pos): @switch) match { - case '[' if tape.isZero => open2close(pos) - case ']' if ! tape.isZero => close2open(pos) - case _ => pos + 1 - }, tape.execute(prog(pos))) - - println("---running---") - ex(0, Tape.empty(func)) - println("\n---done---") - } - } - - val bf = new Brainfuck(ByteFunc) - bf.execute(""">+++++++++[<++++++++>-]<.>+++++++[<++ - ++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] - <.#>+++++++++++[<+++++>-]<.>++++++++[<++ - +>-]<.+++.------.--------.[-]>++++++++[<++++> - -]<+.[-]++++++++++.""") - }.eval -} diff --git a/test/pending/run/reify_callccinterpreter.check b/test/pending/run/reify_callccinterpreter.check deleted file mode 100644 index ef8fc121df..0000000000 --- a/test/pending/run/reify_callccinterpreter.check +++ /dev/null @@ -1,3 +0,0 @@ -42 -wrong -5 diff --git a/test/pending/run/reify_callccinterpreter.scala b/test/pending/run/reify_callccinterpreter.scala deleted file mode 100644 index 82c70da28f..0000000000 --- a/test/pending/run/reify_callccinterpreter.scala +++ /dev/null @@ -1,88 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - type Answer = Value; - - /** - * A continuation monad. - */ - case class M[A](in: (A => Answer) => Answer) { - def bind[B](k: A => M[B]) = M[B](c => in (a => k(a) in c)) - def map[B](f: A => B): M[B] = bind(x => unitM(f(x))) - def flatMap[B](f: A => M[B]): M[B] = bind(f) - } - - def unitM[A](a: A) = M[A](c => c(a)) - - def id[A] = (x: A) => x - def showM(m: M[Value]): String = (m in id).toString() - - def callCC[A](h: (A => M[A]) => M[A]) = - M[A](c => h(a => M[A](d => c(a))) in c) - - type Name = String - - trait Term - case class Var(x: Name) extends Term - case class Con(n: Int) extends Term - case class Add(l: Term, r: Term) extends Term - case class Lam(x: Name, body: Term) extends Term - case class App(fun: Term, arg: Term) extends Term - case class Ccc(x: Name, t: Term) extends Term - - trait Value - case object Wrong extends Value { - override def toString() = "wrong" - } - case class Num(n: Int) extends Value { - override def toString() = n.toString() - } - case class Fun(f: Value => M[Value]) extends Value { - override def toString() = "<function>" - } - - type Environment = List[Tuple2[Name, Value]]; - - def lookup(x: Name, e: Environment): M[Value] = e match { - case List() => unitM(Wrong) - case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) - } - - def add(a: Value, b: Value): M[Value] = (a, b) match { - case (Num(m), Num(n)) => unitM(Num(m + n)) - case _ => unitM(Wrong) - } - - def apply(a: Value, b: Value): M[Value] = a match { - case Fun(k) => k(b) - case _ => unitM(Wrong) - } - - def interp(t: Term, e: Environment): M[Value] = t match { - case Var(x) => lookup(x, e) - case Con(n) => unitM(Num(n)) - case Add(l, r) => for (a <- interp(l, e); - b <- interp(r, e); - c <- add(a, b)) - yield c - 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, (x, Fun(k)) :: e)) - } - - def test(t: Term): String = showM(interp(t, List())) - - val term0 = App(Lam("x", Add(Var("x"), Var("x"))), Add(Con(10), Con(11))) - val term1 = App(Con(1), Con(2)) - val term2 = Add(Con(1), Ccc("k", Add(Con(2), App(Var("k"), Con(4))))) - - println(test(term0)) - println(test(term1)) - println(test(term2)) - }.eval -} diff --git a/test/pending/run/reify_closure2b.check b/test/pending/run/reify_closure2b.check deleted file mode 100644 index c1f3abd7e6..0000000000 --- a/test/pending/run/reify_closure2b.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/test/pending/run/reify_closure2b.scala b/test/pending/run/reify_closure2b.scala deleted file mode 100644 index 0f126c8c91..0000000000 --- a/test/pending/run/reify_closure2b.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo(y: Int): Int => Int = { - class Foo(y: Int) { - val fun = reify{(x: Int) => { - x + y - }} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(y).fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closure3b.check b/test/pending/run/reify_closure3b.check deleted file mode 100644 index c1f3abd7e6..0000000000 --- a/test/pending/run/reify_closure3b.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/test/pending/run/reify_closure3b.scala b/test/pending/run/reify_closure3b.scala deleted file mode 100644 index 54ac52ba0b..0000000000 --- a/test/pending/run/reify_closure3b.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo(y: Int): Int => Int = { - class Foo(y: Int) { - def y1 = y - - val fun = reify{(x: Int) => { - x + y1 - }} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(y).fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closure4b.check b/test/pending/run/reify_closure4b.check deleted file mode 100644 index c1f3abd7e6..0000000000 --- a/test/pending/run/reify_closure4b.check +++ /dev/null @@ -1,2 +0,0 @@ -11 -12 diff --git a/test/pending/run/reify_closure4b.scala b/test/pending/run/reify_closure4b.scala deleted file mode 100644 index 34f707e092..0000000000 --- a/test/pending/run/reify_closure4b.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo(y: Int): Int => Int = { - class Foo(y: Int) { - val y1 = y - - val fun = reify{(x: Int) => { - x + y1 - }} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(y).fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(1)(10)) - println(foo(2)(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closure5b.check b/test/pending/run/reify_closure5b.check deleted file mode 100644 index df9e19c591..0000000000 --- a/test/pending/run/reify_closure5b.check +++ /dev/null @@ -1,2 +0,0 @@ -13 -14 diff --git a/test/pending/run/reify_closure5b.scala b/test/pending/run/reify_closure5b.scala deleted file mode 100644 index 0e506bf7b5..0000000000 --- a/test/pending/run/reify_closure5b.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo[T](ys: List[T]): Int => Int = { - class Foo[T](ys: List[T]) { - val fun = reify{(x: Int) => { - x + ys.length - }} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(ys).fun.tree) - dyn.asInstanceOf[Int => Int] - } - - println(foo(List(1, 2, 3))(10)) - println(foo(List(1, 2, 3, 4))(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closure9a.check b/test/pending/run/reify_closure9a.check deleted file mode 100644 index 9a037142aa..0000000000 --- a/test/pending/run/reify_closure9a.check +++ /dev/null @@ -1 +0,0 @@ -10
\ No newline at end of file diff --git a/test/pending/run/reify_closure9a.scala b/test/pending/run/reify_closure9a.scala deleted file mode 100644 index f39ff1e2f3..0000000000 --- a/test/pending/run/reify_closure9a.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo(y: Int) = { - class Foo(val y: Int) { - def fun = reify{y} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(y).fun.tree) - dyn.asInstanceOf[Int] - } - - println(foo(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closure9b.check b/test/pending/run/reify_closure9b.check deleted file mode 100644 index 9a037142aa..0000000000 --- a/test/pending/run/reify_closure9b.check +++ /dev/null @@ -1 +0,0 @@ -10
\ No newline at end of file diff --git a/test/pending/run/reify_closure9b.scala b/test/pending/run/reify_closure9b.scala deleted file mode 100644 index a6920b4e02..0000000000 --- a/test/pending/run/reify_closure9b.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def foo(y: Int) = { - class Foo(y: Int) { - def fun = reify{y} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(new Foo(y).fun.tree) - dyn.asInstanceOf[Int] - } - - println(foo(10)) -}
\ No newline at end of file diff --git a/test/pending/run/reify_closures11.check b/test/pending/run/reify_closures11.check deleted file mode 100644 index d8263ee986..0000000000 --- a/test/pending/run/reify_closures11.check +++ /dev/null @@ -1 +0,0 @@ -2
\ No newline at end of file diff --git a/test/pending/run/reify_closures11.scala b/test/pending/run/reify_closures11.scala deleted file mode 100644 index 9156208b40..0000000000 --- a/test/pending/run/reify_closures11.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - def fun() = { - def z() = 2 - reify{z} - } - - val toolbox = cm.mkToolBox() - val dyn = toolbox.eval(fun().tree) - val foo = dyn.asInstanceOf[Int] - println(foo) -}
\ No newline at end of file diff --git a/test/pending/run/reify_gadts.check b/test/pending/run/reify_gadts.check deleted file mode 100644 index d81cc0710e..0000000000 --- a/test/pending/run/reify_gadts.check +++ /dev/null @@ -1 +0,0 @@ -42 diff --git a/test/pending/run/reify_gadts.scala b/test/pending/run/reify_gadts.scala deleted file mode 100644 index 582c0802f7..0000000000 --- a/test/pending/run/reify_gadts.scala +++ /dev/null @@ -1,39 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - /* The syntax tree of a toy language */ - abstract class Term[T] - - /* An integer literal */ - case class Lit(x: Int) extends Term[Int] - - /* Successor of a number */ - case class Succ(t: Term[Int]) extends Term[Int] - - /* Is 't' equal to zero? */ - case class IsZero(t: Term[Int]) extends Term[Boolean] - - /* An 'if' expression. */ - case class If[T](c: Term[Boolean], - t1: Term[T], - t2: Term[T]) extends Term[T] - - /** A type-safe eval function. The right-hand sides can - * make use of the fact that 'T' is a more precise type, - * constraint by the pattern type. - */ - def eval[T](t: Term[T]): T = t match { - case Lit(n) => n - - // the right hand side makes use of the fact - // that T = Int and so it can use '+' - case Succ(u) => eval(u) + 1 - case IsZero(u) => eval(u) == 0 - case If(c, u1, u2) => eval(if (eval(c)) u1 else u2) - } - println( - eval(If(IsZero(Lit(1)), Lit(41), Succ(Lit(41))))) - }.eval -} diff --git a/test/pending/run/reify_newimpl_07.scala b/test/pending/run/reify_newimpl_07.scala deleted file mode 100644 index b6886b8bb7..0000000000 --- a/test/pending/run/reify_newimpl_07.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - { - class C(val y: Int) { - val code = reify { - reify{y}.splice - } - } - - println(new C(2).code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_08.scala b/test/pending/run/reify_newimpl_08.scala deleted file mode 100644 index 6caa33f30d..0000000000 --- a/test/pending/run/reify_newimpl_08.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - val code = reify { - class C(val y: Int) { - val code = reify { - reify{y}.splice - } - } - - new C(2).code.splice - } - - println(code.eval) -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_09.scala b/test/pending/run/reify_newimpl_09.scala deleted file mode 100644 index 27fbd37b71..0000000000 --- a/test/pending/run/reify_newimpl_09.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_09a.scala b/test/pending/run/reify_newimpl_09a.scala deleted file mode 100644 index 27fbd37b71..0000000000 --- a/test/pending/run/reify_newimpl_09a.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_09b.scala b/test/pending/run/reify_newimpl_09b.scala deleted file mode 100644 index 9e86dd5d8d..0000000000 --- a/test/pending/run/reify_newimpl_09b.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - type U = Int - type T = U - val code = reify { - List[T](2) - } - println(code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_09c.scala b/test/pending/run/reify_newimpl_09c.scala deleted file mode 100644 index 6bde36328e..0000000000 --- a/test/pending/run/reify_newimpl_09c.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - def foo[W] = { - type U = W - type T = U - reify { - List[T](2) - } - } - val code = foo[Int] - println(code.tree.freeTypes) - val W = code.tree.freeTypes(2) - cm.mkToolBox().eval(code.tree, Map(W -> definitions.IntTpe)) - println(code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_10.scala b/test/pending/run/reify_newimpl_10.scala deleted file mode 100644 index 791e52943a..0000000000 --- a/test/pending/run/reify_newimpl_10.scala +++ /dev/null @@ -1,14 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - type T = Int - implicit val tt = implicitly[TypeTag[String]].asInstanceOf[TypeTag[T]] // this "mistake" is made for a reason! - val code = reify { - List[T](2) - } - println(code.eval) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_16.scala b/test/pending/run/reify_newimpl_16.scala deleted file mode 100644 index a0cadf4d48..0000000000 --- a/test/pending/run/reify_newimpl_16.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - class C { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } - - new C - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_17.scala b/test/pending/run/reify_newimpl_17.scala deleted file mode 100644 index 8fbcd52502..0000000000 --- a/test/pending/run/reify_newimpl_17.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - class C[U] { - type T = U - val code = reify { - List[T](2.asInstanceOf[T]) - } - println(code.eval) - } - - try { - new C[Int] - } catch { - case ex: Throwable => - println(ex) - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_28.scala b/test/pending/run/reify_newimpl_28.scala deleted file mode 100644 index 524a110704..0000000000 --- a/test/pending/run/reify_newimpl_28.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - object C { - type T = Int - val code = reify { - List[T](2) - } - println(code.eval) - } - - C - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_32.scala b/test/pending/run/reify_newimpl_32.scala deleted file mode 100644 index 095e59d919..0000000000 --- a/test/pending/run/reify_newimpl_32.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - object C { - type T = Int - val code = reify { - List[C.T](2) - } - println(code.eval) - } - - C - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_34.scala b/test/pending/run/reify_newimpl_34.scala deleted file mode 100644 index a0a575ed7d..0000000000 --- a/test/pending/run/reify_newimpl_34.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -object Test extends App { - { - object C { - type T = Int - lazy val c = C - val code = reify { - List[c.T](2) - } - println(code.eval) - } - - C - } -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_46.scala b/test/pending/run/reify_newimpl_46.scala deleted file mode 100644 index d063be0486..0000000000 --- a/test/pending/run/reify_newimpl_46.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - class C[T[_] >: Null] { - val code = reify{val x: T[String] = null; println("ima worx"); x}.tree - println(code.freeTypes) - val T = code.freeTypes(0) - cm.mkToolBox().eval(code, Map(T -> definitions.ListClass.asType)) - } - - new C[List] -}
\ No newline at end of file diff --git a/test/pending/run/reify_newimpl_53.scala b/test/pending/run/reify_newimpl_53.scala deleted file mode 100644 index 54fa4bec1d..0000000000 --- a/test/pending/run/reify_newimpl_53.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{universe => ru} -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -object Test extends App { - class C[T >: Null] { - val code = reify{ - val tt = implicitly[TypeTag[T]] - println("mah typetag is: %s".format(tt)) - }.tree - println(code.freeTypes) - val T = code.freeTypes(0) - cm.mkToolBox().eval(code, Map(T -> definitions.StringClass.asType)) - } - - new C[String] -}
\ No newline at end of file diff --git a/test/pending/run/reify_simpleinterpreter.check b/test/pending/run/reify_simpleinterpreter.check deleted file mode 100644 index 4344dc9009..0000000000 --- a/test/pending/run/reify_simpleinterpreter.check +++ /dev/null @@ -1,2 +0,0 @@ -42 -wrong diff --git a/test/pending/run/reify_simpleinterpreter.scala b/test/pending/run/reify_simpleinterpreter.scala deleted file mode 100644 index 1f6d6c8da7..0000000000 --- a/test/pending/run/reify_simpleinterpreter.scala +++ /dev/null @@ -1,75 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Test extends App { - reify { - case class M[A](value: A) { - def bind[B](k: A => M[B]): M[B] = k(value) - def map[B](f: A => B): M[B] = bind(x => unitM(f(x))) - def flatMap[B](f: A => M[B]): M[B] = bind(f) - } - - def unitM[A](a: A): M[A] = M(a) - - def showM(m: M[Value]): String = m.value.toString(); - - type Name = String - - trait Term; - case class Var(x: Name) extends Term - case class Con(n: Int) extends Term - case class Add(l: Term, r: Term) extends Term - case class Lam(x: Name, body: Term) extends Term - case class App(fun: Term, arg: Term) extends Term - - trait Value - case object Wrong extends Value { - override def toString() = "wrong" - } - case class Num(n: Int) extends Value { - override def toString() = n.toString() - } - case class Fun(f: Value => M[Value]) extends Value { - override def toString() = "<function>" - } - - type Environment = List[Tuple2[Name, Value]] - - def lookup(x: Name, e: Environment): M[Value] = e match { - case List() => unitM(Wrong) - case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) - } - - def add(a: Value, b: Value): M[Value] = (a, b) match { - case (Num(m), Num(n)) => unitM(Num(m + n)) - case _ => unitM(Wrong) - } - - def apply(a: Value, b: Value): M[Value] = a match { - case Fun(k) => k(b) - case _ => unitM(Wrong) - } - - def interp(t: Term, e: Environment): M[Value] = t match { - case Var(x) => lookup(x, e) - case Con(n) => unitM(Num(n)) - case Add(l, r) => for (a <- interp(l, e); - b <- interp(r, e); - c <- add(a, b)) - yield c - 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 - } - - def test(t: Term): String = - showM(interp(t, List())) - - val term0 = App(Lam("x", Add(Var("x"), Var("x"))), Add(Con(10), Con(11))) - val term1 = App(Con(1), Con(2)) - - println(test(term0)) - println(test(term1)) - }.eval -} diff --git a/test/pending/run/signals.scala b/test/pending/run/signals.scala deleted file mode 100644 index 608b3c7fd5..0000000000 --- a/test/pending/run/signals.scala +++ /dev/null @@ -1,22 +0,0 @@ -// not exactly "pending", here as an example usage. -// -val manager = scala.tools.util.SignalManager - -manager.requireInterval(3, manager.INT) { - case true => Console.println("\nPress ctrl-C again to exit.") - case false => System.exit(1) -} - -manager("HUP") = println("HUP 1!") -manager("HUP").raise() - -manager("HUP") += println("HUP 2!") -manager("HUP").raise() - -manager("HUP") += println("HUP 3!") -manager("HUP").raise() - -manager("HUP") = println("Back to HUP 1!") -manager("HUP").raise() - -manager.dump() diff --git a/test/pending/run/sigtp.check b/test/pending/run/sigtp.check deleted file mode 100644 index a4d0f55ece..0000000000 --- a/test/pending/run/sigtp.check +++ /dev/null @@ -1,11 +0,0 @@ -BugBase - (m) public abstract A BugBase.key() - (m) public abstract E BugBase.next() - (m) public abstract void BugBase.next_$eq(E) -Bug - (m) public Bug<A, B> Bug.foo() - (m) public A Bug.key() - (m) public Bug<A, B> Bug.next() (bridge) - (m) public void Bug.next_$eq(Bug<A, B>) (bridge) - (f) private final A Bug.key - (f) private java.lang.Object Bug.next diff --git a/test/pending/run/sigtp.scala b/test/pending/run/sigtp.scala deleted file mode 100644 index f8e050dbdc..0000000000 --- a/test/pending/run/sigtp.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.tools.partest._ - -trait BugBase [A, E] { - val key: A - var next: E = _ -} - -final class Bug[A, B](val key: A) extends BugBase[A, Bug[A, B]] { - def foo = next -} - -object Test extends SigTest { - def main(args: Array[String]): Unit = { - show[BugBase[_, _]]() - show[Bug[_, _]]() - } -} diff --git a/test/pending/run/string-reverse.scala b/test/pending/run/string-reverse.scala deleted file mode 100644 index 976a970dec..0000000000 --- a/test/pending/run/string-reverse.scala +++ /dev/null @@ -1,22 +0,0 @@ -/** In case we ever feel like taking on unicode string reversal. - * See ticket #2565. - */ -object Test { - val xs = "Les Mise\u0301rables" // this is the tricky one to reverse - val ys = "Les Misérables" - val xs2 = new StringBuilder(xs) - val ys2 = new StringBuilder(ys) - - def main(args: Array[String]): Unit = { - val out = new java.io.PrintStream(System.out, true, "UTF-8") - - out.println("Strings") - List(xs, xs.reverse, ys, ys.reverse) foreach (out println _) - - out.println("StringBuilder") - out.println(xs2.toString) - out.println(xs2.reverseContents().toString) - out.println(ys2.toString) - out.println(ys2.reverseContents().toString) - } -}
\ No newline at end of file diff --git a/test/pending/run/structural-types-vs-anon-classes.scala b/test/pending/run/structural-types-vs-anon-classes.scala deleted file mode 100644 index 23410e3955..0000000000 --- a/test/pending/run/structural-types-vs-anon-classes.scala +++ /dev/null @@ -1,17 +0,0 @@ -object Test { - class Arm - class Leg - class Tail - class Monkey(arms: List[Arm], legs :List[Leg], tail: Tail) - - def makeAwesomeMonkey(arms: List[Arm], legs: List[Leg], tail: Tail) = { - object m extends Monkey(arms, legs, tail) { - def beAwesome () = "I can fly! I can fly!" - } - m - } - - def main(args: Array[String]): Unit = { - println(makeAwesomeMonkey(Nil, Nil, new Tail) beAwesome) - } -} diff --git a/test/pending/run/t0508x.scala b/test/pending/run/t0508x.scala deleted file mode 100644 index 12d3d09711..0000000000 --- a/test/pending/run/t0508x.scala +++ /dev/null @@ -1,21 +0,0 @@ - final object Test extends java.lang.Object with Application { - - class Foo(val s: String, val n: Int) extends java.lang.Object { - }; - - def foo[A >: Nothing <: Any, B >: Nothing <: Any, C >: Nothing <: Any] - (unapply1: (A) => Option[(B, C)], v: A): Unit = - unapply1.apply(v) match { - case Some((fst @ _, snd @ _)) => - scala.Predef.println(scala.Tuple2.apply[java.lang.String, java.lang.String]("first: ".+(fst), " second: ".+(snd))) - case _ => scala.Predef.println(":(") - } - Test.this.foo[Test.Foo, String, Int]({ - ((eta$0$1: Test.Foo) => Test.this.Foo.unapply(eta$0$1)) - }, Test.this.Foo.apply("this might be fun", 10)); - final object Foo extends java.lang.Object with ((String, Int) => Test.Foo) { - def unapply(x$0: Test.Foo): Some[(String, Int)] = scala.Some.apply[(String, Int)](scala.Tuple2.apply[String, Int](x$0.s, x$0.n)); - def apply(s: String, n: Int): Test.Foo = new Test.this.Foo(s, n) - } - } - diff --git a/test/pending/run/t1980.scala b/test/pending/run/t1980.scala deleted file mode 100644 index 71c178d634..0000000000 --- a/test/pending/run/t1980.scala +++ /dev/null @@ -1,27 +0,0 @@ -// by-name argument incorrectly evaluated on :-ending operator -// Reported by: extempore Owned by: odersky -// Priority: normal Component: Compiler -// Keywords: Cc: paulp@… -// Fixed in version: -// Description - -scala> def foo() = { println("foo") ; 5 } -foo: ()Int - -scala> class C { def m1(f: => Int) = () ; def m2_:(f: => Int) = () } -defined class C - -scala> val c = new C -c: C = C@96d484 - -scala> c m1 foo() - -scala> foo() m2_: c -foo - -// But it is not evaluated if invoked directly: - -scala> c.m2_:(foo()) - -// scala> - diff --git a/test/pending/run/t2034.scala b/test/pending/run/t2034.scala deleted file mode 100644 index a599dc2224..0000000000 --- a/test/pending/run/t2034.scala +++ /dev/null @@ -1,15 +0,0 @@ -// no idea, reassigned to Iulian -object Test { - - def main(args: Array[String]) { - val fooz = new foo.foo2 - println(fooz) - } - - object foo { - class foo2 { - override def toString = getClass.toString//.getSimpleName - } - } - -} diff --git a/test/pending/run/t2364.check b/test/pending/run/t2364.check deleted file mode 100644 index 219305e43a..0000000000 --- a/test/pending/run/t2364.check +++ /dev/null @@ -1 +0,0 @@ -<test></test> diff --git a/test/pending/run/t2364.scala b/test/pending/run/t2364.scala deleted file mode 100644 index d5805a13b8..0000000000 --- a/test/pending/run/t2364.scala +++ /dev/null @@ -1,60 +0,0 @@ -import java.io.ByteArrayInputStream -import java.io.ByteArrayOutputStream -import com.sun.xml.internal.fastinfoset._ -import com.sun.xml.internal.fastinfoset.sax._ -import scala.xml.parsing.NoBindingFactoryAdapter -import scala.xml._ - -// Note - this is in pending because com.sun.xml.etc is not standard, -// and I don't have time to extract a smaller test. - -object Test { - def main(args: Array[String]) { - val node = <test/> - val bytes = new ByteArrayOutputStream - val serializer = new SAXDocumentSerializer() - - serializer.setOutputStream(bytes) - serializer.startDocument() - serialize(node, serializer) - serializer.endDocument() - println(parse(new ByteArrayInputStream(bytes.toByteArray))) - } - def serialize(node: Node, serializer: SAXDocumentSerializer) { - node match { - case _ : ProcInstr | _ : Comment | _ : EntityRef => - case x : Atom[_] => - val chars = x.text.toCharArray - serializer.characters(chars, 0, chars.length) - case _ : Elem => - serializer.startElement("", node.label.toLowerCase, node.label.toLowerCase, attributes(node.attributes)) - for (m <- node.child) serialize(m, serializer) - serializer.endElement("", node.label.toLowerCase, node.label.toLowerCase) - } - } - def parse(str: ByteArrayInputStream) = { - val parser = new SAXDocumentParser - val fac = new NoBindingFactoryAdapter - - parser.setContentHandler(fac) - try { - parser.parse(str) - } catch { - case x: Exception => - x.printStackTrace - } - fac.rootElem - } - def attributes(d: MetaData) = { - val attrs = new AttributesHolder - - if (d != null) { - for (attr <- d) { - val sb = new StringBuilder() - Utility.sequenceToXML(attr.value, TopScope, sb, true) - attrs.addAttribute(new QualifiedName("", "", attr.key.toLowerCase), sb.toString) - } - } - attrs - } -} diff --git a/test/pending/run/t2897.scala b/test/pending/run/t2897.scala deleted file mode 100644 index 40fd3c2b08..0000000000 --- a/test/pending/run/t2897.scala +++ /dev/null @@ -1,22 +0,0 @@ -class A { - def f1(t: String) = { - trait T { - def xs = Nil map (_ => t) - } - } - def f2(t: String) = { - def xs = Nil map (_ => t) - } - def f3(t: String) = { - var t1 = 5 - trait T { - def xs = { t1 = 10 ; t } - } - } - def f4() = { - var u = 5 - trait T { - def xs = Nil map (_ => u = 10) - } - } -} diff --git a/test/pending/run/t3609.scala b/test/pending/run/t3609.scala deleted file mode 100644 index eb25afd667..0000000000 --- a/test/pending/run/t3609.scala +++ /dev/null @@ -1,28 +0,0 @@ -object Test extends Application { - class A - class B extends A - def foo(x: A, y: B) = print(1) - val foo = new { - // def apply(x: B, y: A) = print(3) - def apply = (x: B, z: B) => print(4) - } - - foo(new B, new B) -} - -// This code prints 1. If we remove comment, then it will print 4. -// Moreover following code prints 3 (which is most strange thing): - -object Test2 extends Application { - class A - class B extends A - def foo(x: A, y: B) = print(1) - val foo = new { - def apply(x: B, y: A) = print(3) - def apply = new { - def apply = (x: B, z: B) => print(4) - } - } - - foo(new B, new B) -}
\ No newline at end of file diff --git a/test/pending/run/t3669.scala b/test/pending/run/t3669.scala deleted file mode 100644 index c60ba98538..0000000000 --- a/test/pending/run/t3669.scala +++ /dev/null @@ -1,22 +0,0 @@ -trait MyTrait[T <: { var id: U }, U] { - def test(t: T): T = { - val v: U = t.id - t.id = v - t - } -} - -class C (var id: String){ - // uncommenting this fixes it - // def id_=(x: AnyRef) { id = x.asInstanceOf[String] } -} - -class Test extends MyTrait[C, String] - -object Test { - def main(args: Array[String]): Unit = { - val t = new Test() - val c1 = new C("a") - val c2 = t.test(c1) - } -} diff --git a/test/pending/run/t3832.scala b/test/pending/run/t3832.scala deleted file mode 100644 index f081d5b3af..0000000000 --- a/test/pending/run/t3832.scala +++ /dev/null @@ -1,7 +0,0 @@ -class Test { - def this(un: Int) = { - this() - def test(xs: List[Int]) = xs map (x => x) - () - } -}
\ No newline at end of file diff --git a/test/pending/run/t3857.check b/test/pending/run/t3857.check deleted file mode 100644 index 520b350ff5..0000000000 --- a/test/pending/run/t3857.check +++ /dev/null @@ -1,11 +0,0 @@ -ScalaGeneric - (m) public java.util.Set<java.lang.String> ScalaGeneric.s() - (m) public void ScalaGeneric.s_$eq(java.util.Set<java.lang.String>) - (f) private java.util.Set<java.lang.String> ScalaGeneric.s -ScalaGeneric2Trait - (m) public abstract java.util.Set<java.lang.String> ScalaGeneric2Trait.s() - (m) public abstract void ScalaGeneric2Trait.s_$eq(java.util.Set<java.lang.String>) -ScalaGeneric2 - (m) public java.util.Set<java.lang.String> ScalaGeneric2.s() (bridge) - (m) public void ScalaGeneric2.s_$eq(java.util.Set<java.lang.String>) (bridge) - (f) private java.util.Set<java.lang.String> ScalaGeneric2.s diff --git a/test/pending/run/t3857.scala b/test/pending/run/t3857.scala deleted file mode 100644 index 62bdc39da9..0000000000 --- a/test/pending/run/t3857.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.tools.partest._ - -class ScalaGeneric { var s: java.util.Set[String] = _ } -trait ScalaGeneric2Trait { var s: java.util.Set[String] = _ } -class ScalaGeneric2 extends ScalaGeneric2Trait { } - -object Test extends SigTest { - def main(args: Array[String]): Unit = { - show[ScalaGeneric]() - show[ScalaGeneric2Trait]() - show[ScalaGeneric2]() - } -} diff --git a/test/pending/run/t3899.check b/test/pending/run/t3899.check deleted file mode 100644 index c317608eab..0000000000 --- a/test/pending/run/t3899.check +++ /dev/null @@ -1,4 +0,0 @@ -a,b -a,b -a,b -a,b diff --git a/test/pending/run/t3899/Base_1.java b/test/pending/run/t3899/Base_1.java deleted file mode 100644 index 114cc0b7a6..0000000000 --- a/test/pending/run/t3899/Base_1.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Base_1 { - public String[] varargs1(String... as) { - return as; - } -} diff --git a/test/pending/run/t3899/Derived_2.scala b/test/pending/run/t3899/Derived_2.scala deleted file mode 100644 index bb4e53784d..0000000000 --- a/test/pending/run/t3899/Derived_2.scala +++ /dev/null @@ -1,30 +0,0 @@ -trait T extends Base_1 { - def t1(as: String*): Array[String] = { - varargs1(as: _*) - } - def t2(as: String*): Array[String] = { - // This is the bug reported in the ticket. - super.varargs1(as: _*) - } -} - -class C extends Base_1 { - def c1(as: String*): Array[String] = { - varargs1(as: _*) - } - def c2(as: String*): Array[String] = { - super.varargs1(as: _*) - } -} - - -object Test extends App { - val t = new T {} - println(t.t1("a", "b").mkString(",")) - println(t.t2("a", "b").mkString(",")) - - val c = new C {} - println(c.c1("a", "b").mkString(",")) - println(c.c2("a", "b").mkString(",")) - -} diff --git a/test/pending/run/t4098.scala b/test/pending/run/t4098.scala deleted file mode 100644 index b74ccf9bff..0000000000 --- a/test/pending/run/t4098.scala +++ /dev/null @@ -1,9 +0,0 @@ -class A(a: Any) { - def this() = { this(b) ; def b = new {} } -} - -object Test { - def main(args: Array[String]): Unit = { - new A ("") - } -} diff --git a/test/pending/run/t4291.check b/test/pending/run/t4291.check deleted file mode 100644 index 30bacfac28..0000000000 --- a/test/pending/run/t4291.check +++ /dev/null @@ -1,87 +0,0 @@ -scala.collection.immutable.List - (m) public java.lang.Object scala.collection.immutable.List.apply(java.lang.Object) (bridge) - (m) public A scala.collection.immutable.List.apply(int) (bridge) -scala.Option - (m) public abstract A scala.Option.get() -scala.Function1 - (m) public abstract R scala.Function1.apply(T1) -scala.collection.Traversable - (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.Iterable - (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.Seq - (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.immutable.Set - (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) - (m) public abstract <B,That> That scala.collection.SetLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<This, B, That>) -scala.collection.immutable.Map - (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.immutable.Vector - (m) public <B,That> That scala.collection.immutable.Vector.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.Vector<A>, B, That>) (bridge) -scala.collection.immutable.Range - (m) public <B,That> That scala.collection.immutable.Range.map(scala.Function1<java.lang.Object, B>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.IndexedSeq<java.lang.Object>, B, That>) (bridge) -scala.collection.Traversable - (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.Iterable - (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.Seq - (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.immutable.Set - (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.immutable.Map - (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) -scala.collection.immutable.Vector - (m) public <B,That> That scala.collection.immutable.Vector.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.Vector<A>, B, That>) (bridge) -scala.collection.immutable.Range - (m) public <B,That> That scala.collection.immutable.Range.flatMap(scala.Function1<java.lang.Object, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.IndexedSeq<java.lang.Object>, B, That>) (bridge) -scala.collection.Traversable - (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) -scala.collection.Iterable - (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) -scala.collection.Seq - (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) -scala.collection.immutable.Set - (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) -scala.collection.immutable.Map - (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) -scala.collection.immutable.Vector - (m) public scala.collection.immutable.Vector<A> scala.collection.immutable.Vector.filter(scala.Function1<A, java.lang.Object>) (bridge) -scala.collection.immutable.Range - (m) public scala.collection.immutable.IndexedSeq<java.lang.Object> scala.collection.immutable.Range.filter(scala.Function1<java.lang.Object, java.lang.Object>) (bridge) -scala.collection.Traversable - (m) public abstract A scala.collection.TraversableLike.head() - (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() -scala.collection.Iterable - (m) public abstract A scala.collection.TraversableLike.head() - (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() - (m) public abstract A scala.collection.IterableLike.head() -scala.collection.Seq - (m) public abstract A scala.collection.TraversableLike.head() - (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() - (m) public abstract A scala.collection.IterableLike.head() -scala.collection.immutable.Set - (m) public abstract A scala.collection.TraversableLike.head() - (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() - (m) public abstract A scala.collection.IterableLike.head() -scala.collection.immutable.Map - (m) public abstract A scala.collection.TraversableLike.head() - (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() - (m) public abstract A scala.collection.IterableLike.head() -scala.collection.immutable.Vector - (m) public A scala.collection.immutable.Vector.head() -scala.collection.immutable.Range - (m) public java.lang.Object scala.collection.immutable.Range.head() (bridge) -scala.collection.Traversable - (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) -scala.collection.Iterable - (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) -scala.collection.Seq - (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) -scala.collection.immutable.Set - (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) -scala.collection.immutable.Map - (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) -scala.collection.immutable.Vector - (m) public <K> scala.collection.immutable.Map<K, scala.collection.immutable.Vector<A>> scala.collection.immutable.Vector.groupBy(scala.Function1<A, K>) (bridge) -scala.collection.immutable.Range - (m) public <K> scala.collection.immutable.Map<K, scala.collection.immutable.IndexedSeq<java.lang.Object>> scala.collection.immutable.Range.groupBy(scala.Function1<java.lang.Object, K>) (bridge) diff --git a/test/pending/run/t4291.scala b/test/pending/run/t4291.scala deleted file mode 100644 index 0213bb2c20..0000000000 --- a/test/pending/run/t4291.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.tools.partest._ - -object Test extends SigTest { - def main(args: Array[String]): Unit = { - show[List[_]]("apply") - show[Option[_]]("get") - show[Function1[_, _]]("apply") - - for (name <- List("map", "flatMap", "filter", "head", "groupBy")) { - show[Traversable[_]](name) - show[Iterable[_]](name) - show[Seq[_]](name) - show[Set[_]](name) - show[Map[_,_]](name) - show[Vector[_]](name) - show[Range](name) - } - } -} diff --git a/test/pending/run/t4460.scala b/test/pending/run/t4460.scala deleted file mode 100644 index 324e2f5bef..0000000000 --- a/test/pending/run/t4460.scala +++ /dev/null @@ -1,12 +0,0 @@ -trait A - -class B(val x: Int) { - self: A => - - def this() = this() -} - -object Test extends B(2) with A { - def main(args: Array[String]) { } -} - diff --git a/test/pending/run/t4511.scala b/test/pending/run/t4511.scala deleted file mode 100644 index 58d4e0c7b0..0000000000 --- a/test/pending/run/t4511.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Interval[@specialized T](val high: T) -class Node[@specialized T](val interval: Interval[T]) { - val x1 = Some(interval.high) -} - -object Test { - def main(args: Array[String]): Unit = { - new Node(new Interval(5)).x1 - } -}
\ No newline at end of file diff --git a/test/pending/run/t4511b.scala b/test/pending/run/t4511b.scala deleted file mode 100644 index 3337fb3203..0000000000 --- a/test/pending/run/t4511b.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.{specialized => spec} - -class Interval[@spec(Int) T](high:T) - -class X1[@spec(Int) T](interval:Interval[T]) { val x = interval } -class Y1[@spec(Int) T](interval:Interval[T]) { val y = Some(interval) } - -class X2[T](val interval:Interval[T]) { val x = interval } -class Y2[T](val interval:Interval[T]) { val y = Some(interval) } - -class X3[@spec(Int) T](val interval:Interval[T]) { val x = interval } -class Y3[@spec(Int) T](val interval:Interval[T]) { val y = Some(interval) } - -object Test { - def tryit(o: => Any) = println(try { "ok: " + o.getClass.getName } catch { case e => "FAIL: " + e + "\n" + e.getStackTrace.mkString("\n ") }) - - def main(args: Array[String]) { - tryit(new X1(new Interval(3))) - tryit(new X2(new Interval(3))) - tryit(new X3(new Interval(3))) - tryit(new Y1(new Interval(3))) - tryit(new Y2(new Interval(3))) - tryit(new Y3(new Interval(3))) - } -} diff --git a/test/pending/run/t4574.scala b/test/pending/run/t4574.scala deleted file mode 100644 index 1dde496aca..0000000000 --- a/test/pending/run/t4574.scala +++ /dev/null @@ -1,13 +0,0 @@ -object Test { - val xs: List[(Int, Int)] = List((2, 2), null) - - def expectMatchError[T](msg: String)(body: => T) { - try { body ; assert(false, "Should not succeed.") } - catch { case _: MatchError => println(msg) } - } - - def main(args: Array[String]): Unit = { - expectMatchError("I hereby refute null!")( for ((x, y) <- xs) yield x ) - expectMatchError("I denounce null as unListLike!")( (null: Any) match { case List(_*) => true } ) - } -} diff --git a/test/pending/run/t4713/JavaAnnots.java b/test/pending/run/t4713/JavaAnnots.java deleted file mode 100644 index 29541b1ee0..0000000000 --- a/test/pending/run/t4713/JavaAnnots.java +++ /dev/null @@ -1,14 +0,0 @@ -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.util.List; - -public abstract class JavaAnnots { - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.FIELD) - public @interface Book { - } - - public static final List<String> Book = null; -}
\ No newline at end of file diff --git a/test/pending/run/t4713/Problem.scala b/test/pending/run/t4713/Problem.scala deleted file mode 100644 index e87f657d2e..0000000000 --- a/test/pending/run/t4713/Problem.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Problem { - def d() { - val v: java.util.List[String] = JavaAnnots.Book - } -} diff --git a/test/pending/run/t4971.scala b/test/pending/run/t4971.scala deleted file mode 100644 index c9b6d6f39f..0000000000 --- a/test/pending/run/t4971.scala +++ /dev/null @@ -1,16 +0,0 @@ -trait A[@specialized(Int) K, @specialized(Double) V] { - def doStuff(k: K, v: V): Unit = sys.error("I am overridden, you cannot call me") -} - -trait B[@specialized(Double) V] extends A[Int, V] { - override def doStuff(k: Int, v: V): Unit = println("Hi - I'm calling doStuff in B") -} - -object Test { - def main(args: Array[String]): Unit = delegate(new B[Double]() {}, 1, 0.1) - - def delegate[@specialized(Int) K, @specialized(Double) V](a: A[K, V], k: K, v: V) { - a.doStuff(k, v) - } -} - diff --git a/test/pending/run/t4996.scala b/test/pending/run/t4996.scala deleted file mode 100644 index 58a8fe16a3..0000000000 --- a/test/pending/run/t4996.scala +++ /dev/null @@ -1,15 +0,0 @@ -object SpecializationAbstractOverride { - - trait A[@specialized(Int) T] { def foo(t: T) } - trait B extends A[Int] { def foo(t: Int) { println("B.foo") } } - trait M extends B { abstract override def foo(t: Int) { super.foo(t) ; println ("M.foo") } } - object C extends B with M - - object D extends B { override def foo(t: Int) { super.foo(t); println("M.foo") } } - - def main(args: Array[String]) { - D.foo(42) // OK, prints B.foo M.foo - C.foo(42) // StackOverflowError - } -} - diff --git a/test/pending/run/t5258b.check b/test/pending/run/t5258b.check deleted file mode 100644 index 283b4225fb..0000000000 --- a/test/pending/run/t5258b.check +++ /dev/null @@ -1 +0,0 @@ -TBI
\ No newline at end of file diff --git a/test/pending/run/t5258b.scala b/test/pending/run/t5258b.scala deleted file mode 100644 index a280513d59..0000000000 --- a/test/pending/run/t5258b.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - class C - println(classOf[C]) - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t5258c.check b/test/pending/run/t5258c.check deleted file mode 100644 index 283b4225fb..0000000000 --- a/test/pending/run/t5258c.check +++ /dev/null @@ -1 +0,0 @@ -TBI
\ No newline at end of file diff --git a/test/pending/run/t5258c.scala b/test/pending/run/t5258c.scala deleted file mode 100644 index 4a656690ba..0000000000 --- a/test/pending/run/t5258c.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - object E extends Enumeration { val foo, bar = Value } - println(E.foo) - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t5284.scala b/test/pending/run/t5284.scala deleted file mode 100644 index b43afed5b8..0000000000 --- a/test/pending/run/t5284.scala +++ /dev/null @@ -1,14 +0,0 @@ -object Test { - def main(args:Array[String]) { - val a = Blarg(Array(1,2,3)) - println(a.m((x:Int) => x+1)) - } -} - -object Blarg { - def apply[T:Manifest](a:Array[T]) = new Blarg(a) -} -class Blarg [@specialized T:Manifest](val a:Array[T]) { - def m[@specialized W>:T,@specialized S](f:W=>S) = f(a(0)) -} - diff --git a/test/pending/run/t5334_1.scala b/test/pending/run/t5334_1.scala deleted file mode 100644 index b75badb145..0000000000 --- a/test/pending/run/t5334_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - class C { override def toString = "C" } - new C - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t5334_2.scala b/test/pending/run/t5334_2.scala deleted file mode 100644 index e082e3b8e3..0000000000 --- a/test/pending/run/t5334_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - class C { override def toString() = "C" } - List((new C, new C)) - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t5427a.check b/test/pending/run/t5427a.check deleted file mode 100644 index d8263ee986..0000000000 --- a/test/pending/run/t5427a.check +++ /dev/null @@ -1 +0,0 @@ -2
\ No newline at end of file diff --git a/test/pending/run/t5427a.scala b/test/pending/run/t5427a.scala deleted file mode 100644 index a7d20922db..0000000000 --- a/test/pending/run/t5427a.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ - -object Foo { val bar = 2 } - -object Test extends App { - val tpe = getType(Foo) - 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.check b/test/pending/run/t5427b.check deleted file mode 100644 index d8263ee986..0000000000 --- a/test/pending/run/t5427b.check +++ /dev/null @@ -1 +0,0 @@ -2
\ No newline at end of file diff --git a/test/pending/run/t5427b.scala b/test/pending/run/t5427b.scala deleted file mode 100644 index af1ae6ea2f..0000000000 --- a/test/pending/run/t5427b.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ - -class Foo { val bar = 2 } - -object Test extends App { - val foo = new Foo - val tpe = getType(foo) - 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.check b/test/pending/run/t5427c.check deleted file mode 100644 index 32c91abbd6..0000000000 --- a/test/pending/run/t5427c.check +++ /dev/null @@ -1 +0,0 @@ -no public member
\ No newline at end of file diff --git a/test/pending/run/t5427c.scala b/test/pending/run/t5427c.scala deleted file mode 100644 index ba71803080..0000000000 --- a/test/pending/run/t5427c.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.reflect.runtime.universe._ - -class Foo(bar: Int) - -object Test extends App { - val foo = new Foo(2) - val tpe = getType(foo) - val bar = tpe.nonPrivateMember(TermName("bar")) - bar match { - case NoSymbol => println("no public member") - case _ => println("i'm screwed") - } -}
\ No newline at end of file diff --git a/test/pending/run/t5427d.check b/test/pending/run/t5427d.check deleted file mode 100644 index d8263ee986..0000000000 --- a/test/pending/run/t5427d.check +++ /dev/null @@ -1 +0,0 @@ -2
\ No newline at end of file diff --git a/test/pending/run/t5427d.scala b/test/pending/run/t5427d.scala deleted file mode 100644 index 1d37dbdde3..0000000000 --- a/test/pending/run/t5427d.scala +++ /dev/null @@ -1,11 +0,0 @@ -import scala.reflect.runtime.universe._ - -class Foo(val bar: Int) - -object Test extends App { - val foo = new Foo(2) - val tpe = getType(foo) - 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/t5610b.check b/test/pending/run/t5610b.check deleted file mode 100644 index 2aa46b3b91..0000000000 --- a/test/pending/run/t5610b.check +++ /dev/null @@ -1 +0,0 @@ -Stroke a kitten diff --git a/test/pending/run/t5610b.scala b/test/pending/run/t5610b.scala deleted file mode 100644 index d922d6333c..0000000000 --- a/test/pending/run/t5610b.scala +++ /dev/null @@ -1,21 +0,0 @@ -object Bug { - def main(args: Array[String]) { - 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") - } - } - - class Result(_str: => String) { - lazy val str = _str - } - - def foo(str: => String)(i: Int) = new Result(str) - - def bar(f: Int => Result) = f(42) -}
\ No newline at end of file diff --git a/test/pending/run/t5692.flags b/test/pending/run/t5692.flags deleted file mode 100644 index cd66464f2f..0000000000 --- a/test/pending/run/t5692.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros
\ No newline at end of file diff --git a/test/pending/run/t5692/Impls_Macros_1.scala b/test/pending/run/t5692/Impls_Macros_1.scala deleted file mode 100644 index 94bcffbcaf..0000000000 --- a/test/pending/run/t5692/Impls_Macros_1.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.reflect.macros.Context - -object Impls { - def impl[A](c: reflect.macros.Context) = c.universe.reify(()) -} - -object Macros { - def decl[A] = macro Impls.impl[A] -}
\ No newline at end of file diff --git a/test/pending/run/t5692/Test_2.scala b/test/pending/run/t5692/Test_2.scala deleted file mode 100644 index 29251a5ef5..0000000000 --- a/test/pending/run/t5692/Test_2.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val x = Macros.decl - def y() { Macros.decl(); } -}
\ No newline at end of file diff --git a/test/pending/run/t5698/client.scala b/test/pending/run/t5698/client.scala deleted file mode 100644 index de672c1809..0000000000 --- a/test/pending/run/t5698/client.scala +++ /dev/null @@ -1,9 +0,0 @@ -package client - - - -object Client extends App { - val peer = actors.remote.Node("localhost", 23456) - val a = actors.remote.RemoteActor.select(peer, 'test) - a ! server.TestMsg -} diff --git a/test/pending/run/t5698/server.scala b/test/pending/run/t5698/server.scala deleted file mode 100644 index e8f3cea225..0000000000 --- a/test/pending/run/t5698/server.scala +++ /dev/null @@ -1,22 +0,0 @@ -package server - - - -object Server extends App { - - class ServerActor extends actors.Actor { - def act() { - actors.remote.RemoteActor.alive(23456) - actors.remote.RemoteActor.register('test, actors.Actor.self) - loop { - react { - case TestMsg => println("Yay!") - } - } - } - } - - val a = new ServerActor - a.start() - -} diff --git a/test/pending/run/t5698/testmsg.scala b/test/pending/run/t5698/testmsg.scala deleted file mode 100644 index 004ff0b8c7..0000000000 --- a/test/pending/run/t5698/testmsg.scala +++ /dev/null @@ -1,5 +0,0 @@ -package server - - - -case object TestMsg diff --git a/test/pending/run/t5722.scala b/test/pending/run/t5722.scala deleted file mode 100644 index 21ace060d6..0000000000 --- a/test/pending/run/t5722.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends App { - def foo[T: ClassTag] = println(classOf[T]) - foo[Int] - foo[Array[Int]] - foo[List[Int]] -}
\ No newline at end of file diff --git a/test/pending/run/t5726a.scala b/test/pending/run/t5726a.scala deleted file mode 100644 index 24d828a159..0000000000 --- a/test/pending/run/t5726a.scala +++ /dev/null @@ -1,17 +0,0 @@ -import language.dynamics - -class DynamicTest extends Dynamic { - def selectDynamic(name: String) = s"value of $name" - def updateDynamic(name: String)(value: Any) { - println(s"You have just updated property '$name' with value: $value") - } -} - -object MyApp extends App { - def testing() { - val test = new DynamicTest - test.firstName = "John" - } - - testing() -}
\ No newline at end of file diff --git a/test/pending/run/t5726b.scala b/test/pending/run/t5726b.scala deleted file mode 100644 index 839dcf40b5..0000000000 --- a/test/pending/run/t5726b.scala +++ /dev/null @@ -1,16 +0,0 @@ -import language.dynamics - -class DynamicTest extends Dynamic { - def updateDynamic(name: String)(value: Any) { - println(s"You have just updated property '$name' with value: $value") - } -} - -object MyApp extends App { - def testing() { - val test = new DynamicTest - test.firstName = "John" - } - - testing() -}
\ No newline at end of file diff --git a/test/pending/run/t5866b.scala b/test/pending/run/t5866b.scala deleted file mode 100644 index 44d8b114b8..0000000000 --- a/test/pending/run/t5866b.scala +++ /dev/null @@ -1,17 +0,0 @@ -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/t5882.scala b/test/pending/run/t5882.scala deleted file mode 100644 index 47996d3068..0000000000 --- a/test/pending/run/t5882.scala +++ /dev/null @@ -1,14 +0,0 @@ -// SIP-15 was revised to allow nested classes in value classes. -// This test checks that their basic functionality. - -class NodeOps(val n: Any) extends AnyVal { self => - class Foo() { def show = self.show(n) } - def show(x: Any) = x.toString -} - - -object Test extends App { - - val n = new NodeOps("abc") - assert(new n.Foo().show == "abc") -} diff --git a/test/pending/run/t5943b1.scala b/test/pending/run/t5943b1.scala deleted file mode 100644 index 79c638fedc..0000000000 --- a/test/pending/run/t5943b1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -// pending until https://issues.scala-lang.org/browse/SI-6393 is fixed -object Test extends App { - val tb = cm.mkToolBox() - val expr = tb.parse("math.sqrt(4.0)") - println(tb.typecheck(expr)) -}
\ No newline at end of file diff --git a/test/pending/run/t5943b2.scala b/test/pending/run/t5943b2.scala deleted file mode 100644 index 85299d9f12..0000000000 --- a/test/pending/run/t5943b2.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.reflect.runtime.{currentMirror => cm} -import scala.tools.reflect.ToolBox - -// pending until https://issues.scala-lang.org/browse/SI-6393 is fixed -object Test extends App { - val tb = cm.mkToolBox() - val expr = tb.parse("math.sqrt(4.0)") - println(tb.eval(expr)) -}
\ No newline at end of file diff --git a/test/pending/run/t6387.check b/test/pending/run/t6387.check deleted file mode 100644 index 83b33d238d..0000000000 --- a/test/pending/run/t6387.check +++ /dev/null @@ -1 +0,0 @@ -1000 diff --git a/test/pending/run/t6387.scala b/test/pending/run/t6387.scala deleted file mode 100644 index bbebb5f511..0000000000 --- a/test/pending/run/t6387.scala +++ /dev/null @@ -1,16 +0,0 @@ -trait A { - def foo: Long -} - -object Test { - def a(): A = new A { - var foo: Long = 1000L - - val test = () => { - foo = 28 - } - } - def main(args: Array[String]) { - println(a().foo) - } -} diff --git a/test/pending/run/t6408.scala b/test/pending/run/t6408.scala deleted file mode 100644 index ff17480b35..0000000000 --- a/test/pending/run/t6408.scala +++ /dev/null @@ -1,11 +0,0 @@ -class X(val i: Int) extends AnyVal { - class Inner(val q: Int) { - def plus = i + q - } -} - -object Test extends App { - val x = new X(11) - val i = new x.Inner(22) - assert(i.plus == 33) -} diff --git a/test/pending/run/t6591_4.check b/test/pending/run/t6591_4.check deleted file mode 100644 index 0f1c0489e9..0000000000 --- a/test/pending/run/t6591_4.check +++ /dev/null @@ -1 +0,0 @@ -Expr(Block(List(ValDef(Modifiers(), newTermName("v"), Select(Ident(newTermName("A")), newTypeName("I")), Apply(Select(New(Select(Ident(newTermName("A")), newTypeName("I"))), nme.CONSTRUCTOR), List()))), Ident(newTermName("v")))) diff --git a/test/pending/run/t6591_4.scala b/test/pending/run/t6591_4.scala deleted file mode 100644 index f20c8e6127..0000000000 --- a/test/pending/run/t6591_4.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.ToolBox -import scala.tools.reflect.Eval - -class O { class I } - -class A extends O { - val code = reify { - val v: I = new I - v - } - println(showRaw(code)) -} - -object Test extends App { - val v: A#I = (new A).code.eval -} diff --git a/test/pending/run/t7733.check b/test/pending/run/t7733.check deleted file mode 100644 index 19765bd501..0000000000 --- a/test/pending/run/t7733.check +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/test/pending/run/t7733/Separate_1.scala b/test/pending/run/t7733/Separate_1.scala deleted file mode 100644 index a326ecd53e..0000000000 --- a/test/pending/run/t7733/Separate_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 28358574ec..0000000000 --- a/test/pending/run/t7733/Test_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -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.flags b/test/pending/run/virtpatmat_anonfun_underscore.flags deleted file mode 100644 index 23e3dc7d26..0000000000 --- a/test/pending/run/virtpatmat_anonfun_underscore.flags +++ /dev/null @@ -1 +0,0 @@ --Yvirtpatmat
\ No newline at end of file diff --git a/test/pending/run/virtpatmat_anonfun_underscore.scala b/test/pending/run/virtpatmat_anonfun_underscore.scala deleted file mode 100644 index db6705d025..0000000000 --- a/test/pending/run/virtpatmat_anonfun_underscore.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - List(1,2,3) map (_ match { case x => x + 1} ) // `_ match` is redundant but shouldn't crash the compiler - List((1,2)) map (_ match { case (x, z) => x + z}) -}
\ No newline at end of file |