diff options
41 files changed, 94 insertions, 323 deletions
diff --git a/test/files/jvm/innerClassAttribute.check b/test/files/jvm/innerClassAttribute.check deleted file mode 100644 index 7c697f9053..0000000000 --- a/test/files/jvm/innerClassAttribute.check +++ /dev/null @@ -1,54 +0,0 @@ -#partest -Ydelambdafy:inline --- A4 -- -A4$$anonfun$f$1 / null / null / 17 -A4$$anonfun$f$1 / null / null / 17 -A4 / f / (Lscala/collection/immutable/List;)Lscala/collection/immutable/List; --- A19 -- -A19$$anonfun$1 / null / null / 17 -A19$$anonfun$2 / null / null / 17 -A19$$anonfun$3 / null / null / 17 -A19$$anonfun$1 / null / null / 17 -A19$$anonfun$2 / null / null / 17 -A19$$anonfun$3 / null / null / 17 -A19 / null / null -A19 / null / null -A19 / null / null --- A20 -- -A20$$anonfun$4 / null / null / 17 -fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1` -A20$$anonfun$4 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$1 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$2 / null / null / 17 -fun2 () => (): itself and the outer closure -A20$$anonfun$4 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$1 / null / null / 17 -fun3 () => () => (): itself, the outer closure and its child closure -A20$$anonfun$4 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$2 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17 -fun4: () => 1: itself and the two outer closures -A20$$anonfun$4 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$2 / null / null / 17 -A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3 / null / null / 17 -enclosing: nested closures have outer class defined, but no outer method -A20 / null / null -A20$$anonfun$4 / null / null -A20$$anonfun$4 / null / null -A20$$anonfun$4$$anonfun$apply$2 / null / null -#partest !-Ydelambdafy:inline --- A4 -- -null / null / null --- A19 -- -null / null / null -null / null / null -null / null / null --- A20 -- -fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1` -fun2 () => (): itself and the outer closure -fun3 () => () => (): itself, the outer closure and its child closure -fun4: () => 1: itself and the two outer closures -enclosing: nested closures have outer class defined, but no outer method -null / null / null -null / null / null -null / null / null -null / null / null diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala index 62c7d94d90..2b690bdd7b 100644 --- a/test/files/jvm/innerClassAttribute/Classes_1.scala +++ b/test/files/jvm/innerClassAttribute/Classes_1.scala @@ -187,41 +187,30 @@ trait A24 extends A24Base { } class SI_9105 { - // the EnclosingMethod attributes depend on the delambdafy strategy (inline vs method) - - // outerClass-inline enclMeth-inline outerClass-method enclMeth-method + // outerClass enclMeth val fun = (s: String) => { - class A // closure null (*) SI_9105 null - def m: Object = { class B; new B } // closure m$1 SI_9105 m$1 - val f: Object = { class C; new C } // closure null (*) SI_9105 null + class A // SI_9105 null + def m: Object = { class B; new B } // SI_9105 m$1 + val f: Object = { class C; new C } // SI_9105 null } def met = (s: String) => { - class D // closure null (*) SI_9105 met - def m: Object = { class E; new E } // closure m$1 SI_9105 m$1 - val f: Object = { class F; new F } // closure null (*) SI_9105 met + class D // SI_9105 met + def m: Object = { class E; new E } // SI_9105 m$1 + val f: Object = { class F; new F } // SI_9105 met } - // (*) the originalOwner chain of A (similar for D) is: SI_9105.fun.$anonfun-value.A - // we can get to the anonfun-class (created by uncurry), but not to the apply method. - // - // for C and F, the originalOwner chain is fun.$anonfun-value.f.C. at later phases, the rawowner of f is - // an apply$sp method of the closure class. we could use that as enclosing method, but it would be unsystematic - // (A / D don't have an encl meth either), and also strange to use the $sp, which is a compilation artifact. - // So using `null` looks more like the situation in the source code: C / F are nested classes of the anon-fun, and - // there's no method in between. - def byName(op: => Any) = 0 val bnV = byName { - class G // closure null (*) SI_9105 null - def m: Object = { class H; new H } // closure m$1 SI_9105 m$1 - val f: Object = { class I; new I } // closure null (*) SI_9105 null + class G // SI_9105 null + def m: Object = { class H; new H } // SI_9105 m$1 + val f: Object = { class I; new I } // SI_9105 null "" } def bnM = byName { - class J // closure null (*) SI_9105 bnM - def m: Object = { class K; new K } // closure m$1 SI_9105 m$1 - val f: Object = { class L; new L } // closure null (*) SI_9105 bnM + class J // SI_9105 bnM + def m: Object = { class K; new K } // SI_9105 m$1 + val f: Object = { class L; new L } // SI_9105 bnM "" } } diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala index 376b3c895b..ca50beae7f 100644 --- a/test/files/jvm/innerClassAttribute/Test.scala +++ b/test/files/jvm/innerClassAttribute/Test.scala @@ -78,9 +78,9 @@ object Test extends BytecodeTest { println(s"${e.outerClass} / ${e.name} / ${e.descriptor}") } - def lambdaClass(anonfunName: String, lambdaName: String): String = { - if (classpath.findClass(anonfunName).isDefined) anonfunName else lambdaName - } + + val methodHandlesLookup = assertMember(_: InnerClassNode, "java/lang/invoke/MethodHandles", "Lookup", flags = publicStatic | Flags.ACC_FINAL) + def testA1() = { val List(b1) = innerClassNodes("A1") @@ -109,11 +109,7 @@ object Test extends BytecodeTest { } def testA4() = { - println("-- A4 --") - printInnerClassNodes("A4") - val fun = lambdaClass("A4$$anonfun$f$1", "A4$lambda$$f$1") - printInnerClassNodes(fun) - printEnclosingMethod(fun) + testInner("A4", methodHandlesLookup) } def testA5() = { @@ -247,47 +243,11 @@ object Test extends BytecodeTest { } def testA19() = { - println("-- A19 --") - - printInnerClassNodes("A19") - - val fun1 = lambdaClass("A19$$anonfun$1", "A19$lambda$1") - val fun2 = lambdaClass("A19$$anonfun$2", "A19$lambda$2") - val fun3 = lambdaClass("A19$$anonfun$3", "A19$lambda$3") - - printInnerClassNodes(fun1) - printInnerClassNodes(fun2) - printInnerClassNodes(fun3) - - printEnclosingMethod(fun1) - printEnclosingMethod(fun2) - printEnclosingMethod(fun3) + testInner("A19", methodHandlesLookup) } def testA20() = { - println("-- A20 --") - - printInnerClassNodes("A20") - - val fun1 = lambdaClass("A20$$anonfun$4", "A20$lambda$1") - val fun2 = lambdaClass("A20$$anonfun$4$$anonfun$apply$1", "A20$lambda$$$nestedInAnonfun$5$1") - val fun3 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2", "A20$lambda$$$nestedInAnonfun$5$2") - val fun4 = lambdaClass("A20$$anonfun$4$$anonfun$apply$2$$anonfun$apply$3", "A20$lambda$$$nestedInAnonfun$7$1") - - println("fun1: attribute for itself and the two child closures `() => ()` and `() => () => 1`") - printInnerClassNodes(fun1) - println("fun2 () => (): itself and the outer closure") - printInnerClassNodes(fun2) - println("fun3 () => () => (): itself, the outer closure and its child closure") - printInnerClassNodes(fun3) - println("fun4: () => 1: itself and the two outer closures") - printInnerClassNodes(fun4) - - println("enclosing: nested closures have outer class defined, but no outer method") - printEnclosingMethod(fun1) - printEnclosingMethod(fun2) - printEnclosingMethod(fun3) - printEnclosingMethod(fun4) + testInner("A20", methodHandlesLookup) } def testA21() = { @@ -337,70 +297,30 @@ object Test extends BytecodeTest { } def testSI_9105() { - val isDelambdafyMethod = classpath.findClass("SI_9105$lambda$1").isDefined - if (isDelambdafyMethod) { - assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null) - assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;") - assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null) - assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;") - assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$3", "()Ljava/lang/Object;") - assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;") - assertNoEnclosingMethod("SI_9105$lambda$$met$1") - assertNoEnclosingMethod("SI_9105$lambda$1") - assertNoEnclosingMethod("SI_9105") - - assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3") - assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5") - assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1") - assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1") - assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1") - assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1") - - // by-name - assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null) - assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$2", "()Ljava/lang/Object;") - assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null) - assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I") - assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;") - assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I") - - assert(innerClassNodes("SI_9105$lambda$$met$1").isEmpty) - assert(innerClassNodes("SI_9105$lambda$1").isEmpty) - assert(innerClassNodes("SI_9105").length == 12) // the 12 local classes - } else { - // comment in innerClassAttribute/Classes_1.scala explains the difference between A / C and D / F. - assertEnclosingMethod ("SI_9105$$anonfun$5$A$3" , "SI_9105$$anonfun$5" , null , null) - assertEnclosingMethod ("SI_9105$$anonfun$5$B$5" , "SI_9105$$anonfun$5" , "m$1" , "()Ljava/lang/Object;") - assertEnclosingMethod ("SI_9105$$anonfun$5$C$1" , "SI_9105$$anonfun$5" , null , null) - assertEnclosingMethod ("SI_9105$$anonfun$met$1$D$1", "SI_9105$$anonfun$met$1", null , null) - assertEnclosingMethod ("SI_9105$$anonfun$met$1$E$1", "SI_9105$$anonfun$met$1", "m$3" , "()Ljava/lang/Object;") - assertEnclosingMethod ("SI_9105$$anonfun$met$1$F$1", "SI_9105$$anonfun$met$1", null , null) - assertEnclosingMethod ("SI_9105$$anonfun$5" , "SI_9105" , null , null) - assertEnclosingMethod ("SI_9105$$anonfun$met$1" , "SI_9105" , "met" , "()Lscala/Function1;") - assertNoEnclosingMethod("SI_9105") - - assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$A$3"), "SI_9105$$anonfun$5$A$3" , "A$3") - assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$B$5"), "SI_9105$$anonfun$5$B$5" , "B$5") - assertLocal(ownInnerClassNode("SI_9105$$anonfun$5$C$1"), "SI_9105$$anonfun$5$C$1" , "C$1") - assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$D$1"), "SI_9105$$anonfun$met$1$D$1", "D$1") - assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$E$1"), "SI_9105$$anonfun$met$1$E$1", "E$1") - assertLocal(ownInnerClassNode("SI_9105$$anonfun$met$1$F$1"), "SI_9105$$anonfun$met$1$F$1", "F$1") - - // by-name - assertEnclosingMethod("SI_9105$$anonfun$6$G$1", "SI_9105$$anonfun$6", null, null) - assertEnclosingMethod("SI_9105$$anonfun$6$H$1", "SI_9105$$anonfun$6", "m$2", "()Ljava/lang/Object;") - assertEnclosingMethod("SI_9105$$anonfun$6$I$1", "SI_9105$$anonfun$6", null, null) - assertEnclosingMethod("SI_9105$$anonfun$bnM$1$J$1", "SI_9105$$anonfun$bnM$1", null, null) - assertEnclosingMethod("SI_9105$$anonfun$bnM$1$K$2", "SI_9105$$anonfun$bnM$1", "m$4", "()Ljava/lang/Object;") - assertEnclosingMethod("SI_9105$$anonfun$bnM$1$L$1", "SI_9105$$anonfun$bnM$1", null, null) - - assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$5"), "SI_9105$$anonfun$5") - assertAnonymous(ownInnerClassNode("SI_9105$$anonfun$met$1"), "SI_9105$$anonfun$met$1") - - assert(innerClassNodes("SI_9105$$anonfun$5").length == 4) // itself and three of the local classes - assert(innerClassNodes("SI_9105$$anonfun$met$1").length == 4) // itself and three of the local classes - assert(innerClassNodes("SI_9105").length == 4) // the four anon funs - } + assertEnclosingMethod ("SI_9105$A$3" , "SI_9105", null , null) + assertEnclosingMethod ("SI_9105$B$5" , "SI_9105", "m$1", "()Ljava/lang/Object;") + assertEnclosingMethod ("SI_9105$C$1" , "SI_9105", null , null) + assertEnclosingMethod ("SI_9105$D$1" , "SI_9105", "met", "()Lscala/Function1;") + assertEnclosingMethod ("SI_9105$E$1" , "SI_9105", "m$3", "()Ljava/lang/Object;") + assertEnclosingMethod ("SI_9105$F$1" , "SI_9105", "met", "()Lscala/Function1;") + assertNoEnclosingMethod("SI_9105") + + assertLocal(innerClassNodes("SI_9105$A$3").head, "SI_9105$A$3", "A$3") + assertLocal(innerClassNodes("SI_9105$B$5").head, "SI_9105$B$5", "B$5") + assertLocal(innerClassNodes("SI_9105$C$1").head, "SI_9105$C$1", "C$1") + assertLocal(innerClassNodes("SI_9105$D$1").head, "SI_9105$D$1", "D$1") + assertLocal(innerClassNodes("SI_9105$E$1").head, "SI_9105$E$1", "E$1") + assertLocal(innerClassNodes("SI_9105$F$1").head, "SI_9105$F$1", "F$1") + + // by-name + assertEnclosingMethod("SI_9105$G$1", "SI_9105", null , null) + assertEnclosingMethod("SI_9105$H$1", "SI_9105", "m$2", "()Ljava/lang/Object;") + assertEnclosingMethod("SI_9105$I$1", "SI_9105", null , null) + assertEnclosingMethod("SI_9105$J$1", "SI_9105", "bnM", "()I") + assertEnclosingMethod("SI_9105$K$2", "SI_9105", "m$4", "()Ljava/lang/Object;") + assertEnclosingMethod("SI_9105$L$1", "SI_9105", "bnM", "()I") + + assert(innerClassNodes("SI_9105").length == 13) // the 12 local classes, plus MethodHandles$Lookup } def testSI_9124() { @@ -530,37 +450,8 @@ object Test extends BytecodeTest { testInner("NestedInValueClass$A$B", am, b) testInner("NestedInValueClass$A$C$2", am, c) - val isDelambdafyMethod = classpath.findClass("NestedInValueClass$A$lambda$$f$extension$1").isDefined - if (isDelambdafyMethod) { - List( - "NestedInValueClass$A$lambda$$g$2$1", - "NestedInValueClass$A$lambda$$f$extension$1", - "NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1", - "NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1").foreach(assertNoEnclosingMethod) - testInner("NestedInValueClass$A", a, am) - testInner("NestedInValueClass$A$", a, am, b, c) - testInner("NestedInValueClass$A$lambda$$g$2$1", am) - testInner("NestedInValueClass$A$lambda$$f$extension$1", am) - testInner("NestedInValueClass$A$lambda$$$nestedInAnonfun$13$1", am) - testInner("NestedInValueClass$A$lambda$$NestedInValueClass$A$$$nestedInAnonfun$15$1", am) - } else { - assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1" , "NestedInValueClass$A" , null, null) - assertEnclosingMethod("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4" , "NestedInValueClass$A$$anonfun$g$2$1" , null, null) - assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1" , "NestedInValueClass$A" , "f", "()Lscala/collection/immutable/List;") - assertEnclosingMethod("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", "NestedInValueClass$A$$anonfun$f$extension$1", null, null) - - val gfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1") - val ffun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1") - val gfunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4") - val ffunfun = assertAnonymous(_: I, "NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5") - - testInner("NestedInValueClass$A", a, am, ffun, gfun) - testInner("NestedInValueClass$A$", a, am, ffun, gfun, b, c) - testInner("NestedInValueClass$A$$anonfun$g$2$1", a, am, gfun, gfunfun) - testInner("NestedInValueClass$A$$anonfun$g$2$1$$anonfun$apply$4", am, gfun, gfunfun) - testInner("NestedInValueClass$A$$anonfun$f$extension$1", a, am, ffun, ffunfun) - testInner("NestedInValueClass$A$$anonfun$f$extension$1$$anonfun$apply$5", am, ffun, ffunfun) - } + testInner("NestedInValueClass$A", a, am) + testInner("NestedInValueClass$A$", a, am, b, c, methodHandlesLookup) } def show(): Unit = { diff --git a/test/files/jvm/javaReflection.check b/test/files/jvm/javaReflection.check index 83518c7990..5f7aafe77c 100644 --- a/test/files/jvm/javaReflection.check +++ b/test/files/jvm/javaReflection.check @@ -1,86 +1,3 @@ -#partest -Ydelambdafy:inline -A$$anonfun$$lessinit$greater$1 / null (canon) / $anonfun$$lessinit$greater$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / public A(int) (constr) / null (meth) -- properties : true (local) / false (member) -A$$anonfun$$lessinit$greater$1$$anonfun$apply$1 / null (canon) / $anonfun$apply$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A$$anonfun$$lessinit$greater$1 (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -A$$anonfun$2 / null (canon) / $anonfun$2 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -A$$anonfun$3 / null (canon) / $anonfun$3 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -A$$anonfun$4 / null (canon) / $anonfun$4 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -A$$anonfun$f$1 / null (canon) / $anonfun$f$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth) -- properties : true (local) / false (member) -A$$anonfun$f$2 / null (canon) / $anonfun$f$2 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A (cls) / null (constr) / public java.lang.Object A.f() (meth) -- properties : true (local) / false (member) -A$D$$anonfun$1 / null (canon) / anonfun$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class A$D$ (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -AO$$anonfun$5 / null (canon) / anonfun$5 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / class AO$ (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -AT$$anonfun$6 / null (canon) / $anonfun$6 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / interface AT (cls) / null (constr) / null (meth) -- properties : true (local) / false (member) -#partest !-Ydelambdafy:inline -A$D$lambda$1 / A$D$lambda$1 (canon) / A$D$lambda$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$$$lessinit$greater$1 / A$lambda$$$lessinit$greater$1 (canon) / A$lambda$$$lessinit$greater$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$$$nestedInAnonfun$7$1 / A$lambda$$$nestedInAnonfun$7$1 (canon) / A$lambda$$$nestedInAnonfun$7$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$$f$1 / A$lambda$$f$1 (canon) / A$lambda$$f$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$$f$2 / A$lambda$$f$2 (canon) / A$lambda$$f$2 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$1 / A$lambda$1 (canon) / A$lambda$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$2 / A$lambda$2 (canon) / A$lambda$2 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -A$lambda$3 / A$lambda$3 (canon) / A$lambda$3 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -AO$lambda$1 / AO$lambda$1 (canon) / AO$lambda$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -AT$class$lambda$1 / AT$class$lambda$1 (canon) / AT$class$lambda$1 (simple) -- declared cls: List() -- enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) -- properties : false (local) / false (member) -#partest A / A (canon) / A (simple) - declared cls: List(class A$B, interface A$C, class A$D$) - enclosing : null (declaring cls) / null (cls) / null (constr) / null (meth) diff --git a/test/files/jvm/patmat_opt_ignore_underscore/test.scala b/test/files/jvm/patmat_opt_ignore_underscore/test.scala index 6179101a7e..d6630e80a0 100644 --- a/test/files/jvm/patmat_opt_ignore_underscore/test.scala +++ b/test/files/jvm/patmat_opt_ignore_underscore/test.scala @@ -1,3 +1,6 @@ +/* + * filter: inliner warning; re-run with + */ import scala.tools.partest.BytecodeTest import scala.tools.nsc.util.JavaClassPath diff --git a/test/files/jvm/patmat_opt_no_nullcheck/test.scala b/test/files/jvm/patmat_opt_no_nullcheck/test.scala index 2927e763d5..d02c929e01 100644 --- a/test/files/jvm/patmat_opt_no_nullcheck/test.scala +++ b/test/files/jvm/patmat_opt_no_nullcheck/test.scala @@ -1,3 +1,6 @@ +/* + * filter: inliner warning; re-run with + */ import scala.tools.partest.BytecodeTest object Test extends BytecodeTest { 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/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/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) } } diff --git a/test/files/run/private-inline.check b/test/pending/run/private-inline.check index e71aec2fcf..e71aec2fcf 100644 --- a/test/files/run/private-inline.check +++ b/test/pending/run/private-inline.check diff --git a/test/files/run/private-inline.flags b/test/pending/run/private-inline.flags index c550fdce16..c550fdce16 100644 --- a/test/files/run/private-inline.flags +++ b/test/pending/run/private-inline.flags diff --git a/test/files/run/private-inline.scala b/test/pending/run/private-inline.scala index 60fef9efca..60fef9efca 100644 --- a/test/files/run/private-inline.scala +++ b/test/pending/run/private-inline.scala diff --git a/test/files/run/reify_csv.check b/test/pending/run/reify_csv.check index b56f4bb50b..b56f4bb50b 100644 --- a/test/files/run/reify_csv.check +++ b/test/pending/run/reify_csv.check diff --git a/test/files/run/reify_csv.scala b/test/pending/run/reify_csv.scala index c35624469c..c35624469c 100644 --- a/test/files/run/reify_csv.scala +++ b/test/pending/run/reify_csv.scala diff --git a/test/files/run/reify_for1.scala b/test/pending/run/reify_for1.scala index e1f5347572..e1f5347572 100644 --- a/test/files/run/reify_for1.scala +++ b/test/pending/run/reify_for1.scala diff --git a/test/files/run/reify_fors_newpatmat.check b/test/pending/run/reify_fors_newpatmat.check index eefddedc20..eefddedc20 100644 --- a/test/files/run/reify_fors_newpatmat.check +++ b/test/pending/run/reify_fors_newpatmat.check diff --git a/test/files/run/reify_fors_newpatmat.scala b/test/pending/run/reify_fors_newpatmat.scala index 6bee9538a8..6bee9538a8 100644 --- a/test/files/run/reify_fors_newpatmat.scala +++ b/test/pending/run/reify_fors_newpatmat.scala diff --git a/test/files/run/reify_fors_oldpatmat.check b/test/pending/run/reify_fors_oldpatmat.check index eefddedc20..eefddedc20 100644 --- a/test/files/run/reify_fors_oldpatmat.check +++ b/test/pending/run/reify_fors_oldpatmat.check diff --git a/test/files/run/reify_fors_oldpatmat.scala b/test/pending/run/reify_fors_oldpatmat.scala index 6bee9538a8..6bee9538a8 100644 --- a/test/files/run/reify_fors_oldpatmat.scala +++ b/test/pending/run/reify_fors_oldpatmat.scala diff --git a/test/files/run/reify_newimpl_51.check b/test/pending/run/reify_newimpl_51.check index 9a4ddeacd3..9a4ddeacd3 100644 --- a/test/files/run/reify_newimpl_51.check +++ b/test/pending/run/reify_newimpl_51.check diff --git a/test/files/run/reify_newimpl_51.scala b/test/pending/run/reify_newimpl_51.scala index f823bf4033..f823bf4033 100644 --- a/test/files/run/reify_newimpl_51.scala +++ b/test/pending/run/reify_newimpl_51.scala diff --git a/test/files/run/reify_newimpl_52.check b/test/pending/run/reify_newimpl_52.check index 9359a2b211..9359a2b211 100644 --- a/test/files/run/reify_newimpl_52.check +++ b/test/pending/run/reify_newimpl_52.check diff --git a/test/files/run/reify_newimpl_52.scala b/test/pending/run/reify_newimpl_52.scala index f01199e830..f01199e830 100644 --- a/test/files/run/reify_newimpl_52.scala +++ b/test/pending/run/reify_newimpl_52.scala diff --git a/test/files/run/reify_properties.check b/test/pending/run/reify_properties.check index d769bea4b0..d769bea4b0 100644 --- a/test/files/run/reify_properties.check +++ b/test/pending/run/reify_properties.check diff --git a/test/files/run/reify_properties.scala b/test/pending/run/reify_properties.scala index 01a9b12a92..01a9b12a92 100644 --- a/test/files/run/reify_properties.scala +++ b/test/pending/run/reify_properties.scala diff --git a/test/files/run/reify_sort1.check b/test/pending/run/reify_sort1.check index 0d30805141..0d30805141 100644 --- a/test/files/run/reify_sort1.check +++ b/test/pending/run/reify_sort1.check diff --git a/test/files/run/reify_sort1.scala b/test/pending/run/reify_sort1.scala index 6fb3cc5895..6fb3cc5895 100644 --- a/test/files/run/reify_sort1.scala +++ b/test/pending/run/reify_sort1.scala diff --git a/test/files/run/t8960.scala b/test/pending/run/t8960.scala index a58ac53d33..a58ac53d33 100644 --- a/test/files/run/t8960.scala +++ b/test/pending/run/t8960.scala |