diff options
Diffstat (limited to 'test/files/run')
35 files changed, 43 insertions, 551 deletions
diff --git a/test/files/run/delambdafyLambdaClassNames.check b/test/files/run/delambdafyLambdaClassNames.check deleted file mode 100644 index d425d15dd0..0000000000 --- a/test/files/run/delambdafyLambdaClassNames.check +++ /dev/null @@ -1 +0,0 @@ -A$$nestedInAnon$1$lambda$$run$1 diff --git a/test/files/run/delambdafyLambdaClassNames.flags b/test/files/run/delambdafyLambdaClassNames.flags deleted file mode 100644 index b10233d322..0000000000 --- a/test/files/run/delambdafyLambdaClassNames.flags +++ /dev/null @@ -1 +0,0 @@ --Ybackend:GenBCode -Ydelambdafy:method
\ No newline at end of file diff --git a/test/files/run/delambdafyLambdaClassNames/A_1.scala b/test/files/run/delambdafyLambdaClassNames/A_1.scala deleted file mode 100644 index 10489414b7..0000000000 --- a/test/files/run/delambdafyLambdaClassNames/A_1.scala +++ /dev/null @@ -1,5 +0,0 @@ -class A { - def f = new Runnable { - def run(): Unit = List(1,2).foreach(println) - } -} diff --git a/test/files/run/delambdafyLambdaClassNames/Test.scala b/test/files/run/delambdafyLambdaClassNames/Test.scala deleted file mode 100644 index 49a397d1d2..0000000000 --- a/test/files/run/delambdafyLambdaClassNames/Test.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends App { - val c = Class.forName("A$$nestedInAnon$1$lambda$$run$1") - println(c.getName) -} diff --git a/test/files/run/private-inline.check b/test/files/run/private-inline.check deleted file mode 100644 index e71aec2fcf..0000000000 --- a/test/files/run/private-inline.check +++ /dev/null @@ -1,13 +0,0 @@ -private-inline.scala:24: warning: Could not inline required method wrapper1 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. - def f1b() = identity(wrapper1(5)) - ^ -private-inline.scala:24: warning: At the end of the day, could not inline @inline-marked method wrapper1 - def f1b() = identity(wrapper1(5)) - ^ -private-inline.scala:29: warning: Could not inline required method wrapper2 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. - def f2b() = identity(wrapper2(5)) - ^ -private-inline.scala:29: warning: At the end of the day, could not inline @inline-marked method wrapper2 - def f2b() = identity(wrapper2(5)) - ^ -20 diff --git a/test/files/run/private-inline.flags b/test/files/run/private-inline.flags deleted file mode 100644 index c550fdce16..0000000000 --- a/test/files/run/private-inline.flags +++ /dev/null @@ -1 +0,0 @@ --optimise -Yinline-warnings -Ybackend:GenASM diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala deleted file mode 100644 index 60fef9efca..0000000000 --- a/test/files/run/private-inline.scala +++ /dev/null @@ -1,52 +0,0 @@ - -final class A { - private var x1 = false - var x2 = false - - // manipulates private var - @inline private def wrapper1[T](body: => T): T = { - val saved = x1 - x1 = true - try body - finally x1 = saved - } - // manipulates public var - @inline private def wrapper2[T](body: => T): T = { - val saved = x2 - x2 = true - try body - finally x2 = saved - } - - // not inlined - def f1a() = wrapper1(5) - // inlined! - def f1b() = identity(wrapper1(5)) - - // not inlined - def f2a() = wrapper2(5) - // inlined! - def f2b() = identity(wrapper2(5)) -} - -object Test { - def methodClasses = List("f1a", "f2a") map ("A$$anonfun$" + _ + "$1") - - def main(args: Array[String]): Unit = { - val a = new A - import a._ - println(f1a() + f1b() + f2a() + f2b()) - - // Don't know how else to test this: all these should have been - // inlined, so all should fail. - methodClasses foreach { clazz => - - val foundClass = ( - try Class.forName(clazz) - catch { case _: Throwable => null } - ) - - assert(foundClass == null, foundClass) - } - } -} diff --git a/test/files/run/reify_csv.check b/test/files/run/reify_csv.check deleted file mode 100644 index b56f4bb50b..0000000000 --- a/test/files/run/reify_csv.check +++ /dev/null @@ -1,10 +0,0 @@ -List(phase name, id, description) -record(parser,1,parse source into ASTs, perform simple desugaring) -record(namer,2,resolve names, attach symbols to named trees) -record(packageobjects,3,load package objects) -record(typer,4,the meat and potatoes: type the trees) -record(superaccessors,5,add super accessors in traits and nested classes) -record(pickler,6,serialize symbol tables) -record(refchecks,7,reference/override checking, translate nested objects) -record(selectiveanf,8,) -record(liftcode,9,reify trees) diff --git a/test/files/run/reify_csv.scala b/test/files/run/reify_csv.scala deleted file mode 100644 index c35624469c..0000000000 --- a/test/files/run/reify_csv.scala +++ /dev/null @@ -1,36 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - val csv = """ - | phase name; id; description - | parser; 1; parse source into ASTs, perform simple desugaring - | namer; 2; resolve names, attach symbols to named trees - |packageobjects; 3; load package objects - | typer; 4; the meat and potatoes: type the trees - |superaccessors; 5; add super accessors in traits and nested classes - | pickler; 6; serialize symbol tables - | refchecks; 7; reference/override checking, translate nested objects - | selectiveanf; 8; - | liftcode; 9; reify trees""".stripMargin.split("\n").map{_.trim()}.drop(1).toList - - val fields = csv.head.split(";").map{_.trim()}.toList - println(fields) - - reify({ - object Csv { - case class record(`phase name`: String, id: String, description: String) - - object record { - def parse(lines: List[String]) = { - lines drop(1) map { line => line.split(";", -1).toList match { - case phase$whitespace$name :: id :: description :: _ => record(phase$whitespace$name.trim(), id.trim(), description.trim()) - case _ => throw new Exception("format error") - }} - } - } - } - - Csv.record.parse(csv) foreach println - }).eval -} diff --git a/test/files/run/reify_for1.scala b/test/files/run/reify_for1.scala deleted file mode 100644 index e1f5347572..0000000000 --- a/test/files/run/reify_for1.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - val sumOfSquares1 = (for (i <- 1 to 100; if (i % 3 == 0)) yield Math.pow(i, 2)).sum - val sumOfSquares2 = (1 to 100).filter(_ % 3 == 0).map(Math.pow(_, 2)).sum - assert(sumOfSquares1 == sumOfSquares2) - }.eval -}
\ No newline at end of file diff --git a/test/files/run/reify_fors_newpatmat.check b/test/files/run/reify_fors_newpatmat.check deleted file mode 100644 index eefddedc20..0000000000 --- a/test/files/run/reify_fors_newpatmat.check +++ /dev/null @@ -1,5 +0,0 @@ -Persons over 20: John Richard -divisors(34) = List(1, 2, 17, 34) -findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) -average(List(3.5, 5.0, 4.5)) = 4.333333333333333 -scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/test/files/run/reify_fors_newpatmat.scala b/test/files/run/reify_fors_newpatmat.scala deleted file mode 100644 index 6bee9538a8..0000000000 --- a/test/files/run/reify_fors_newpatmat.scala +++ /dev/null @@ -1,101 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - object Persons { - /** A list of persons. To create a list, we use Predef.List - * which takes a variable number of arguments and constructs - * a list out of them. - */ - val persons = List( - new Person("Bob", 17), - new Person("John", 40), - new Person("Richard", 68) - ) - - /** A Person class. 'val' constructor parameters become - * public members of the class. - */ - class Person(val name: String, val age: Int) - - /** Return an iterator over persons that are older than 20. - */ - def olderThan20(xs: Seq[Person]): Iterator[String] = - olderThan20(xs.iterator) - - /** Return an iterator over persons older than 20, given - * an iterator over persons. - */ - def olderThan20(xs: Iterator[Person]): Iterator[String] = { - - // The first expression is called a 'generator' and makes - // 'p' take values from 'xs'. The second expression is - // called a 'filter' and it is a boolean expression which - // selects only persons older than 20. There can be more than - // one generator and filter. The 'yield' expression is evaluated - // for each 'p' which satisfies the filters and used to assemble - // the resulting iterator - for (p <- xs if p.age > 20) yield p.name - } - } - - /** Some functions over lists of numbers which demonstrate - * the use of for comprehensions. - */ - object Numeric { - - /** Return the divisors of n. */ - def divisors(n: Int): List[Int] = - for (i <- List.range(1, n+1) if n % i == 0) yield i - - /** Is 'n' a prime number? */ - def isPrime(n: Int) = divisors(n).length == 2 - - /** Return pairs of numbers whose sum is prime. */ - def findNums(n: Int): Iterable[(Int, Int)] = { - - // a for comprehension using two generators - for (i <- 1 until n; - j <- 1 until (i-1); - if isPrime(i + j)) yield (i, j) - } - - /** Return the sum of the elements of 'xs'. */ - def sum(xs: List[Double]): Double = - xs.foldLeft(0.0) { (x, y) => x + y } - - /** Return the sum of pairwise product of the two lists. */ - def scalProd(xs: List[Double], ys: List[Double]) = - sum(for((x, y) <- xs zip ys) yield x * y); - - /** Remove duplicate elements in 'xs'. */ - def removeDuplicates[A](xs: List[A]): List[A] = - if (xs.isEmpty) - xs - else - xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) - } - - // import all members of object 'persons' in the current scope - import Persons._ - - print("Persons over 20:") - olderThan20(persons) foreach { x => print(" " + x) } - println - - import Numeric._ - - println("divisors(34) = " + divisors(34)) - - print("findNums(15) =") - findNums(15) foreach { x => print(" " + x) } - println - - val xs = List(3.5, 5.0, 4.5) - println("average(" + xs + ") = " + sum(xs) / xs.length) - - val ys = List(2.0, 1.0, 3.0) - println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) - }.eval -}
\ No newline at end of file diff --git a/test/files/run/reify_fors_oldpatmat.check b/test/files/run/reify_fors_oldpatmat.check deleted file mode 100644 index eefddedc20..0000000000 --- a/test/files/run/reify_fors_oldpatmat.check +++ /dev/null @@ -1,5 +0,0 @@ -Persons over 20: John Richard -divisors(34) = List(1, 2, 17, 34) -findNums(15) = (4,1) (5,2) (6,1) (7,4) (8,3) (8,5) (9,2) (9,4) (10,1) (10,3) (10,7) (11,2) (11,6) (11,8) (12,1) (12,5) (12,7) (13,4) (13,6) (13,10) (14,3) (14,5) (14,9) -average(List(3.5, 5.0, 4.5)) = 4.333333333333333 -scalProd(List(3.5, 5.0, 4.5), List(2.0, 1.0, 3.0)) = 25.5 diff --git a/test/files/run/reify_fors_oldpatmat.scala b/test/files/run/reify_fors_oldpatmat.scala deleted file mode 100644 index 6bee9538a8..0000000000 --- a/test/files/run/reify_fors_oldpatmat.scala +++ /dev/null @@ -1,101 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - object Persons { - /** A list of persons. To create a list, we use Predef.List - * which takes a variable number of arguments and constructs - * a list out of them. - */ - val persons = List( - new Person("Bob", 17), - new Person("John", 40), - new Person("Richard", 68) - ) - - /** A Person class. 'val' constructor parameters become - * public members of the class. - */ - class Person(val name: String, val age: Int) - - /** Return an iterator over persons that are older than 20. - */ - def olderThan20(xs: Seq[Person]): Iterator[String] = - olderThan20(xs.iterator) - - /** Return an iterator over persons older than 20, given - * an iterator over persons. - */ - def olderThan20(xs: Iterator[Person]): Iterator[String] = { - - // The first expression is called a 'generator' and makes - // 'p' take values from 'xs'. The second expression is - // called a 'filter' and it is a boolean expression which - // selects only persons older than 20. There can be more than - // one generator and filter. The 'yield' expression is evaluated - // for each 'p' which satisfies the filters and used to assemble - // the resulting iterator - for (p <- xs if p.age > 20) yield p.name - } - } - - /** Some functions over lists of numbers which demonstrate - * the use of for comprehensions. - */ - object Numeric { - - /** Return the divisors of n. */ - def divisors(n: Int): List[Int] = - for (i <- List.range(1, n+1) if n % i == 0) yield i - - /** Is 'n' a prime number? */ - def isPrime(n: Int) = divisors(n).length == 2 - - /** Return pairs of numbers whose sum is prime. */ - def findNums(n: Int): Iterable[(Int, Int)] = { - - // a for comprehension using two generators - for (i <- 1 until n; - j <- 1 until (i-1); - if isPrime(i + j)) yield (i, j) - } - - /** Return the sum of the elements of 'xs'. */ - def sum(xs: List[Double]): Double = - xs.foldLeft(0.0) { (x, y) => x + y } - - /** Return the sum of pairwise product of the two lists. */ - def scalProd(xs: List[Double], ys: List[Double]) = - sum(for((x, y) <- xs zip ys) yield x * y); - - /** Remove duplicate elements in 'xs'. */ - def removeDuplicates[A](xs: List[A]): List[A] = - if (xs.isEmpty) - xs - else - xs.head :: removeDuplicates(for (x <- xs.tail if x != xs.head) yield x) - } - - // import all members of object 'persons' in the current scope - import Persons._ - - print("Persons over 20:") - olderThan20(persons) foreach { x => print(" " + x) } - println - - import Numeric._ - - println("divisors(34) = " + divisors(34)) - - print("findNums(15) =") - findNums(15) foreach { x => print(" " + x) } - println - - val xs = List(3.5, 5.0, 4.5) - println("average(" + xs + ") = " + sum(xs) / xs.length) - - val ys = List(2.0, 1.0, 3.0) - println("scalProd(" + xs + ", " + ys +") = " + scalProd(xs, ys)) - }.eval -}
\ No newline at end of file diff --git a/test/files/run/reify_newimpl_51.check b/test/files/run/reify_newimpl_51.check deleted file mode 100644 index 9a4ddeacd3..0000000000 --- a/test/files/run/reify_newimpl_51.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -1 -2
\ No newline at end of file diff --git a/test/files/run/reify_newimpl_51.scala b/test/files/run/reify_newimpl_51.scala deleted file mode 100644 index f823bf4033..0000000000 --- a/test/files/run/reify_newimpl_51.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - val bar = reify { println(x * y) } - bar.eval - println(x) - println(y) - } - code.eval - } -}
\ No newline at end of file diff --git a/test/files/run/reify_newimpl_52.check b/test/files/run/reify_newimpl_52.check deleted file mode 100644 index 9359a2b211..0000000000 --- a/test/files/run/reify_newimpl_52.check +++ /dev/null @@ -1,3 +0,0 @@ -2 -2 -1
\ No newline at end of file diff --git a/test/files/run/reify_newimpl_52.scala b/test/files/run/reify_newimpl_52.scala deleted file mode 100644 index f01199e830..0000000000 --- a/test/files/run/reify_newimpl_52.scala +++ /dev/null @@ -1,18 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - { - var counter = 0 - lazy val x = { counter += 1; counter } - lazy val y = { counter += 1; counter } - val code = reify { - def foo = y // ensures that y is the first freevar we find - val bar = reify { println(y * x) } - bar.eval - println(x) - println(y) - } - code.eval - } -}
\ No newline at end of file diff --git a/test/files/run/reify_properties.check b/test/files/run/reify_properties.check deleted file mode 100644 index d769bea4b0..0000000000 --- a/test/files/run/reify_properties.check +++ /dev/null @@ -1,2 +0,0 @@ -user1: MR. ROBERT <noname> -user2: MR. BOB KUZ diff --git a/test/files/run/reify_properties.scala b/test/files/run/reify_properties.scala deleted file mode 100644 index 01a9b12a92..0000000000 --- a/test/files/run/reify_properties.scala +++ /dev/null @@ -1,57 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - /** A mutable property whose getter and setter may be customized. */ - case class Property[T](init: T) { - private var value: T = init - - /** The getter function, defaults to identity. */ - private var setter: T => T = identity[T] - - /** The setter function, defaults to identity. */ - private var getter: T => T = identity[T] - - /** Retrive the value held in this property. */ - def apply(): T = getter(value) - - /** Update the value held in this property, through the setter. */ - def update(newValue: T) = value = setter(newValue) - - /** Change the getter. */ - def get(newGetter: T => T) = { getter = newGetter; this } - - /** Change the setter */ - def set(newSetter: T => T) = { setter = newSetter; this } - } - - class User { - // Create a property with custom getter and setter - val firstname = Property("") - .get { v => v.toUpperCase() } - .set { v => "Mr. " + v } - val lastname = Property("<noname>") - - /** Scala provides syntactic sugar for calling 'apply'. Simply - * adding a list of arguments between parenthesis (in this case, - * an empty list) is translated to a call to 'apply' with those - * arguments. - */ - override def toString() = firstname() + " " + lastname() - } - - val user1 = new User - - // Syntactic sugar for 'update': an assignment is translated to a - // call to method 'update' - user1.firstname() = "Robert" - - val user2 = new User - user2.firstname() = "bob" - user2.lastname() = "KUZ" - - println("user1: " + user1) - println("user2: " + user2) - }.eval -} diff --git a/test/files/run/reify_sort1.check b/test/files/run/reify_sort1.check deleted file mode 100644 index 0d30805141..0000000000 --- a/test/files/run/reify_sort1.check +++ /dev/null @@ -1,2 +0,0 @@ -List(6, 2, 8, 5, 1) -List(1, 2, 5, 6, 8) diff --git a/test/files/run/reify_sort1.scala b/test/files/run/reify_sort1.scala deleted file mode 100644 index 6fb3cc5895..0000000000 --- a/test/files/run/reify_sort1.scala +++ /dev/null @@ -1,21 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - def sort(a: List[Int]): List[Int] = { - if (a.length < 2) - a - else { - val pivot = a(a.length / 2) - sort(a.filter(_ < pivot)) ::: - a.filter(_ == pivot) ::: - sort(a.filter(_ > pivot)) - } - } - - val xs = List(6, 2, 8, 5, 1) - println(xs) - println(sort(xs)) - }.eval -}
\ No newline at end of file diff --git a/test/files/run/repl-parens.scala b/test/files/run/repl-parens.scala index e25933b1a2..43e642a806 100644 --- a/test/files/run/repl-parens.scala +++ b/test/files/run/repl-parens.scala @@ -26,4 +26,11 @@ foo(5)(10)(15)+foo(5)(10)(15) List(1) ++ List('a') """.trim + + // replace indylambda function names by <function0> + override def eval() = { + val lines = super.eval + val r = """\$\$Lambda.*""".r + lines.map(l => r.replaceAllIn(l, "<function0>")) + } } diff --git a/test/files/run/t3158.scala b/test/files/run/t3158.scala index c824b62e96..1e5ec186f5 100644 --- a/test/files/run/t3158.scala +++ b/test/files/run/t3158.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]) { - println(args.map(_ => foo _).deep) + println(args.map(_ => foo _).map(_ => "<function1>").deep) } def foo(xs: String*) { diff --git a/test/files/run/t5535.scala b/test/files/run/t5535.scala index 7bc12f3470..2833b9c94b 100644 --- a/test/files/run/t5535.scala +++ b/test/files/run/t5535.scala @@ -7,4 +7,11 @@ println(h()(5)) val f = h() _ println(f(10)) """ + + // replace indylambda function names by <function1> + override def eval() = { + val lines = super.eval + val r = """\$\$Lambda.*""".r + lines.map(l => r.replaceAllIn(l, "<function1>")) + } } diff --git a/test/files/run/t5789.scala b/test/files/run/t5789.scala index 461f6a4aae..2903dada48 100644 --- a/test/files/run/t5789.scala +++ b/test/files/run/t5789.scala @@ -10,5 +10,12 @@ object Test extends ReplTest { val n = 2 () => n """ + + // replace indylambda function names by <function0> + override def eval() = { + val lines = super.eval + val r = """\$\$Lambda.*""".r + lines.map(l => r.replaceAllIn(l, "<function0>")) + } } diff --git a/test/files/run/t6260-delambdafy.check b/test/files/run/t6260-delambdafy.check index b2a7bed988..2fea68afb1 100644 --- a/test/files/run/t6260-delambdafy.check +++ b/test/files/run/t6260-delambdafy.check @@ -1,4 +1,4 @@ f(C@2e) -Test$lambda$1$$apply apply +writeReplace diff --git a/test/files/run/t6260-delambdafy.flags b/test/files/run/t6260-delambdafy.flags deleted file mode 100644 index 48b438ddf8..0000000000 --- a/test/files/run/t6260-delambdafy.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/run/t6260c.check b/test/files/run/t6260c.check index 1f17b1791b..388f6690d6 100644 --- a/test/files/run/t6260c.check +++ b/test/files/run/t6260c.check @@ -1,9 +1,5 @@ f(C@2e) -#partest -Ydelambdafy:inline -Test$$anonfun$$apply -#partest !-Ydelambdafy:inline -Test$lambda$1$$apply -#partest apply +writeReplace g(C@2e) diff --git a/test/files/run/t6434.scala b/test/files/run/t6434.scala index e4a4579613..6b6a783299 100644 --- a/test/files/run/t6434.scala +++ b/test/files/run/t6434.scala @@ -5,4 +5,11 @@ object Test extends ReplTest { """def f(x: => Int): Int = x f _ """ + + // replace indylambda function names by <function1> + override def eval() = { + val lines = super.eval + val r = """\$\$Lambda.*""".r + lines.map(l => r.replaceAllIn(l, "<function1>")) + } } diff --git a/test/files/run/t6546.flags b/test/files/run/t6546.flags index eb4d19bcb9..6015e7c61f 100644 --- a/test/files/run/t6546.flags +++ b/test/files/run/t6546.flags @@ -1 +1 @@ --optimise
\ No newline at end of file +-Ybackend:GenASM -optimise
\ No newline at end of file diff --git a/test/files/run/t7008-scala-defined/Test_3.scala b/test/files/run/t7008-scala-defined/Test_3.scala index ee7b9d9cde..26178142ab 100644 --- a/test/files/run/t7008-scala-defined/Test_3.scala +++ b/test/files/run/t7008-scala-defined/Test_3.scala @@ -1,3 +1,6 @@ +/* + * filter: inliner warning; re-run with + */ import scala.reflect.runtime.universe._ object Test extends App { diff --git a/test/files/run/t7747-repl.scala b/test/files/run/t7747-repl.scala index 141c2d9844..9b2d1c40be 100644 --- a/test/files/run/t7747-repl.scala +++ b/test/files/run/t7747-repl.scala @@ -8,6 +8,13 @@ object Test extends ReplTest { s } + // replace indylambda function names by <function0> + override def eval() = { + val lines = super.eval + val r = """\$Lambda.*""".r + lines.map(l => r.replaceAllIn(l, "<function0>")) + } + def code = """ |var x = 10 |var y = 11 diff --git a/test/files/run/t8960.scala b/test/files/run/t8960.scala deleted file mode 100644 index a58ac53d33..0000000000 --- a/test/files/run/t8960.scala +++ /dev/null @@ -1,72 +0,0 @@ -object Test extends App { - def test(o: AnyRef, sp: Boolean = false) = { - val isSpecialized = o.getClass.getSuperclass.getName contains "$sp" - val isDelambdafyMethod = o.getClass.getName contains "$lambda$" - assert( - // delambdafy:method doesn't currently emit specialized anonymous function classes - if (sp) (isSpecialized || isDelambdafyMethod) else !isSpecialized, - o.getClass.getName) - - val Some(f) = o.getClass.getDeclaredFields.find(_.getName == "serialVersionUID") - assert(f.getLong(null) == 0l) - } - - test(() => (), sp = true) - test(() => 1, sp = true) - test(() => "") - - test((x: Int) => x, sp = true) - test((x: Boolean) => x) - test((x: Int) => "") - - test((x1: Int, x2: Int) => 0d, sp = true) - test((x1: Int, x2: AnyRef) => 0d) - test((x1: Any, x2: Any) => x1) - - // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" test((", ", ", ") => x1)")).mkString("\n")) - - test((x1: Int, x2: Int, x3: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int) => x1) - test((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) => x1) - - test({ - case x: Int => x - }: PartialFunction[Int, Int], sp = true) - - test({ - case x: Int => x - }: PartialFunction[Any, Any]) - - test({ - case x: Int => () - }: PartialFunction[Int, Unit], sp = true) - - test({ - case x: String => 1 - }: PartialFunction[String, Int]) - - test({ - case x: String => () - }: PartialFunction[String, Unit]) - - test({ - case x: String => x - }: PartialFunction[String, String]) -} diff --git a/test/files/run/t9097.scala b/test/files/run/t9097.scala index aa2b23bbac..2b5cf66a75 100644 --- a/test/files/run/t9097.scala +++ b/test/files/run/t9097.scala @@ -29,6 +29,6 @@ object Test extends StoreReporterDirectTest { assert(!storeReporter.hasErrors, message = filteredInfos map (_.msg) mkString "; ") val out = baos.toString("UTF-8") // was 2 before the fix, the two PackageDefs for a would both contain the ClassDef for the closure - assert(out.lines.count(_ contains "class hihi$1") == 1, out) + assert(out.lines.count(_ contains "def $anonfun$1(x$1: Int): String") == 1, out) } } |