diff options
Diffstat (limited to 'test/files/run')
92 files changed, 552 insertions, 657 deletions
diff --git a/test/files/run/analyzerPlugins.check b/test/files/run/analyzerPlugins.check index 9803465ddc..1bb7c6ceab 100644 --- a/test/files/run/analyzerPlugins.check +++ b/test/files/run/analyzerPlugins.check @@ -19,7 +19,7 @@ canAdaptAnnotations(Trees$Typed, Any) [1] canAdaptAnnotations(Trees$Typed, Int) [1] lub(List(Int @testAnn, Int)) [1] pluginsPt(?, Trees$Annotated) [7] -pluginsPt(?, Trees$Apply) [8] +pluginsPt(?, Trees$Apply) [11] pluginsPt(?, Trees$ApplyImplicitView) [2] pluginsPt(?, Trees$Assign) [7] pluginsPt(?, Trees$Block) [4] @@ -31,7 +31,7 @@ pluginsPt(?, Trees$Literal) [16] pluginsPt(?, Trees$New) [5] pluginsPt(?, Trees$PackageDef) [1] pluginsPt(?, Trees$Return) [1] -pluginsPt(?, Trees$Select) [47] +pluginsPt(?, Trees$Select) [50] pluginsPt(?, Trees$Super) [2] pluginsPt(?, Trees$This) [20] pluginsPt(?, Trees$TypeApply) [3] @@ -93,6 +93,7 @@ pluginsTypeSigAccessor(value x) [1] pluginsTypeSigAccessor(value y) [1] pluginsTypeSigAccessor(variable count) [2] pluginsTyped( <: Int, Trees$TypeBoundsTree) [2] +pluginsTyped(()Double, Trees$Select) [6] pluginsTyped(()Object, Trees$Select) [1] pluginsTyped(()String, Trees$Ident) [1] pluginsTyped(()String, Trees$TypeApply) [1] @@ -112,7 +113,7 @@ pluginsTyped(<notype>, Trees$PackageDef) [1] pluginsTyped(<notype>, Trees$TypeDef) [1] pluginsTyped(<notype>, Trees$ValDef) [21] pluginsTyped(=> Boolean @testAnn, Trees$Select) [1] -pluginsTyped(=> Double, Trees$Select) [4] +pluginsTyped(=> Double, Trees$Select) [1] pluginsTyped(=> Int, Trees$Select) [5] pluginsTyped(=> Int, Trees$TypeApply) [1] pluginsTyped(=> String @testAnn, Trees$Select) [1] @@ -131,6 +132,7 @@ pluginsTyped(Boolean(false), Trees$Literal) [2] pluginsTyped(Boolean, Trees$Apply) [1] pluginsTyped(Boolean, Trees$Select) [4] pluginsTyped(Char('c'), Trees$Literal) [2] +pluginsTyped(Double, Trees$Apply) [3] pluginsTyped(Double, Trees$Select) [6] pluginsTyped(Int @testAnn, Trees$TypeTree) [2] pluginsTyped(Int @testAnn, Trees$Typed) [2] diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala index 81df2f08d9..a62bcb147d 100644 --- a/test/files/run/classfile-format-51.scala +++ b/test/files/run/classfile-format-51.scala @@ -1,6 +1,5 @@ import java.io.{File, FileOutputStream} -import scala.tools.nsc.settings.ScalaVersion import scala.tools.partest._ import scala.tools.asm import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes} diff --git a/test/files/run/classfile-format-52.scala b/test/files/run/classfile-format-52.scala index 453f61ac84..e278d40b8b 100644 --- a/test/files/run/classfile-format-52.scala +++ b/test/files/run/classfile-format-52.scala @@ -1,6 +1,5 @@ import java.io.{File, FileOutputStream} -import scala.tools.nsc.settings.ScalaVersion import scala.tools.partest._ import scala.tools.asm import asm.{AnnotationVisitor, ClassWriter, FieldVisitor, Handle, MethodVisitor, Opcodes} diff --git a/test/files/run/concurrent-stream.check b/test/files/run/concurrent-stream.check deleted file mode 100644 index d4adf84490..0000000000 --- a/test/files/run/concurrent-stream.check +++ /dev/null @@ -1,3 +0,0 @@ -Testing standard cons. -Evaluation 0: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) -Evaluation 1: List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala deleted file mode 100644 index 9d5ba0428e..0000000000 --- a/test/files/run/concurrent-stream.scala +++ /dev/null @@ -1,37 +0,0 @@ -// test concurrent calls to Stream.tail -@deprecated("Suppress warnings", since="2.11") -object Test { - - def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = { - var current = from - def next: Stream[Int] = { - Thread.sleep(100) - if (current >= until) Stream.empty - else { - val stream = cons(current, next) - current += 1 - stream - } - } - next - } - - def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = { - import scala.actors.Actor._ - - val stream = slowRange(0, 10, cons) - val main = self - actor { main ! stream.toList } - actor { main ! stream.toList } - val eval0 = receive { case list: List[Int @unchecked] => list } - val eval1 = receive { case list: List[Int @unchecked] => list } - println("Evaluation 0: " + eval0) - println("Evaluation 1: " + eval1) - } - - def main(args: Array[String]) { - println("Testing standard cons.") - testCons(Stream.cons.apply(_, _)) - } -} - diff --git a/test/files/run/delambdafy-specialized.flags b/test/files/run/delambdafy-specialized.flags index 48b438ddf8..d6278aa940 100644 --- a/test/files/run/delambdafy-specialized.flags +++ b/test/files/run/delambdafy-specialized.flags @@ -1 +1 @@ --Ydelambdafy:method +-Ydelambdafy:method -Ybackend:GenASM 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/delambdafy_t6028.check b/test/files/run/delambdafy_t6028.check index 419e7043a3..9ff1d0e78e 100644 --- a/test/files/run/delambdafy_t6028.check +++ b/test/files/run/delambdafy_t6028.check @@ -21,7 +21,7 @@ package <empty> { def tryy(tryyParam: String): Function0 = { var tryyLocal: runtime.ObjectRef = scala.runtime.ObjectRef.create(""); { - (new <$anon: Function0>(T.this, tryyParam, tryyLocal): Function0) + (() => T.this.$anonfun$2(tryyParam, tryyLocal)).$asInstanceOf[Function0]() } }; final <artifact> private[this] def $anonfun$1(methodParam$1: String, methodLocal$1: String): String = T.this.classParam.+(T.this.field()).+(methodParam$1).+(methodLocal$1); @@ -48,24 +48,9 @@ package <empty> { }; scala.this.Predef.print(barParam$1) }; - @SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable { - def <init>($outer: T, tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): <$anon: Function0> = { - $anonfun$tryy$1.super.<init>(); - () - }; - final def apply(): Unit = $anonfun$tryy$1.this.apply$mcV$sp(); - <specialized> def apply$mcV$sp(): Unit = try { - $anonfun$tryy$1.this.tryyLocal$1.elem = $anonfun$tryy$1.this.tryyParam$1 - } finally (); - <synthetic> <paramaccessor> <artifact> private[this] val $outer: T = _; - <synthetic> <stable> <artifact> def $outer(): T = $anonfun$tryy$1.this.$outer; - final <bridge> <artifact> def apply(): Object = { - $anonfun$tryy$1.this.apply(); - scala.runtime.BoxedUnit.UNIT - }; - <synthetic> <paramaccessor> private[this] val tryyParam$1: String = _; - <synthetic> <paramaccessor> private[this] val tryyLocal$1: runtime.ObjectRef = _ - } + final <artifact> private[this] def $anonfun$2(tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): Unit = try { + tryyLocal$1.elem = tryyParam$1 + } finally () } } diff --git a/test/files/run/duration-coarsest.scala b/test/files/run/duration-coarsest.scala index 51cb79287a..81fbb3cc84 100644 --- a/test/files/run/duration-coarsest.scala +++ b/test/files/run/duration-coarsest.scala @@ -25,4 +25,7 @@ object Test extends App { 23 hours, 40 days ) foreach (x => assert(x == x.toCoarsest, x)) -}
\ No newline at end of file + + // toCoarsest on a FiniteDuration should return a FiniteDuration + val finite: FiniteDuration = 1.second.toCoarsest +} diff --git a/test/files/run/future-flatmap-exec-count.check b/test/files/run/future-flatmap-exec-count.check index dd9dce64ed..7065c133e0 100644 --- a/test/files/run/future-flatmap-exec-count.check +++ b/test/files/run/future-flatmap-exec-count.check @@ -1,3 +1,4 @@ +warning: there was one deprecation warning; re-run with -deprecation for details mapping execute() flatmapping diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check index 7c885d2cc9..36fc2eefa4 100644 --- a/test/files/run/inline-ex-handlers.check +++ b/test/files/run/inline-ex-handlers.check @@ -30,7 +30,7 @@ - - 7: 92 LOAD_LOCAL(value x1) -@@ -390,5 +386,5 @@ +@@ -408,5 +404,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, value ex6, value x4, value x5, value message, value x + locals: value args, variable result, value ex6, value x4, value x5, value x @@ -38,7 +38,7 @@ - blocks: [1,2,3,4,5,8,10,11,13] + blocks: [1,2,3,5,8,10,11,13,14] -@@ -416,4 +412,13 @@ +@@ -434,4 +430,13 @@ 103 CALL_METHOD MyException.<init> (static-instance) - 103 THROW(MyException) + ? STORE_LOCAL(value ex6) @@ -53,13 +53,13 @@ + 106 CZJUMP (BOOL)NE ? 5 : 8 + 13: -@@ -429,5 +434,2 @@ +@@ -447,5 +452,2 @@ 101 SCOPE_ENTER value x4 - 101 JUMP 4 - - 4: 106 LOAD_LOCAL(value x4) -@@ -441,8 +443,5 @@ +@@ -459,8 +461,5 @@ 106 SCOPE_ENTER value x5 - 106 LOAD_LOCAL(value x5) - 106 CALL_METHOD MyException.message (dynamic) @@ -70,12 +70,12 @@ + ? LOAD_LOCAL(value x5) + 106 CALL_METHOD MyException.message (dynamic) 106 CALL_METHOD scala.Predef.println (dynamic) -@@ -518,3 +517,3 @@ +@@ -536,3 +535,3 @@ startBlock: 1 - blocks: [1,2,3,4,6,7,9,10] + blocks: [1,3,4,6,7,9,10,11,12,13] -@@ -547,4 +546,9 @@ +@@ -565,4 +564,9 @@ 306 CALL_METHOD MyException.<init> (static-instance) - 306 THROW(MyException) + ? JUMP 11 @@ -86,12 +86,12 @@ + ? JUMP 12 + 9: -@@ -553,3 +557,3 @@ +@@ -571,3 +575,3 @@ 305 MONITOR_EXIT - ? THROW(Throwable) + ? JUMP 12 -@@ -559,4 +563,11 @@ +@@ -577,4 +581,11 @@ 304 MONITOR_EXIT - ? THROW(Throwable) + ? STORE_LOCAL(value t) @@ -104,7 +104,7 @@ + ? JUMP 13 + 3: -@@ -573,5 +584,14 @@ +@@ -591,5 +602,14 @@ 310 CALL_METHOD scala.Predef.println (dynamic) - 310 JUMP 2 + 300 RETURN(UNIT) @@ -121,21 +121,21 @@ + 310 CALL_PRIMITIVE(EndConcat) + 310 CALL_METHOD scala.Predef.println (dynamic) 300 RETURN(UNIT) -@@ -583,6 +603,6 @@ +@@ -601,6 +621,6 @@ with finalizer: null -- catch (Throwable) in ArrayBuffer(7, 9, 10) starting at: 6 -+ catch (Throwable) in ArrayBuffer(7, 9, 10, 11) starting at: 6 +- catch (Throwable) in Vector(7, 9, 10) starting at: 6 ++ catch (Throwable) in Vector(7, 9, 10, 11) starting at: 6 consisting of blocks: List(6) with finalizer: null -- catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10) starting at: 3 -+ catch (Throwable) in ArrayBuffer(4, 6, 7, 9, 10, 11, 12) starting at: 3 +- catch (Throwable) in Vector(4, 6, 7, 9, 10) starting at: 3 ++ catch (Throwable) in Vector(4, 6, 7, 9, 10, 11, 12) starting at: 3 consisting of blocks: List(3) -@@ -618,3 +638,3 @@ +@@ -636,3 +656,3 @@ startBlock: 1 - blocks: [1,3,4,5,6,8,9] + blocks: [1,3,4,5,6,8,9,10,11] -@@ -642,4 +662,10 @@ +@@ -660,4 +680,10 @@ 78 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance) - 78 THROW(IllegalArgumentException) + ? STORE_LOCAL(value e) @@ -147,13 +147,13 @@ + ? JUMP 11 + 8: -@@ -668,3 +694,4 @@ +@@ -686,3 +712,4 @@ 81 LOAD_LOCAL(value e) - 81 THROW(Exception) + ? STORE_LOCAL(variable exc1) + ? JUMP 11 -@@ -685,2 +712,15 @@ +@@ -703,2 +730,15 @@ + 11: + 83 LOAD_MODULE object Predef @@ -169,12 +169,12 @@ + 84 THROW(Throwable) + } -@@ -690,3 +730,3 @@ +@@ -708,3 +748,3 @@ with finalizer: null -- catch (<none>) in ArrayBuffer(4, 5, 6, 8) starting at: 3 -+ catch (<none>) in ArrayBuffer(4, 5, 6, 8, 10) starting at: 3 +- catch (<none>) in Vector(4, 5, 6, 8) starting at: 3 ++ catch (<none>) in Vector(4, 5, 6, 8, 10) starting at: 3 consisting of blocks: List(3) -@@ -714,5 +754,5 @@ +@@ -732,5 +772,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value message, value x, value ex6, value x4, value x5, value message, value x + locals: value args, variable result, value ex6, variable exc2, value x4, value x5, value x, value ex6, value x4, value x5, value x @@ -182,7 +182,7 @@ - blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24] + blocks: [1,3,4,5,6,9,13,14,15,18,20,21,23,24,25,26,27] -@@ -740,4 +780,11 @@ +@@ -758,4 +798,11 @@ 172 CALL_METHOD MyException.<init> (static-instance) - 172 THROW(MyException) + ? STORE_LOCAL(value ex6) @@ -195,7 +195,7 @@ + 170 JUMP 14 + 23: -@@ -780,8 +827,5 @@ +@@ -798,8 +845,5 @@ 175 SCOPE_ENTER value x5 - 175 LOAD_LOCAL(value x5) - 175 CALL_METHOD MyException.message (dynamic) @@ -206,7 +206,7 @@ + ? LOAD_LOCAL(value x5) + 176 CALL_METHOD MyException.message (dynamic) 176 CALL_METHOD scala.Predef.println (dynamic) -@@ -789,5 +833,7 @@ +@@ -807,5 +851,7 @@ 177 DUP(REF(class MyException)) - 177 LOAD_LOCAL(value message) + ? LOAD_LOCAL(value x5) @@ -216,13 +216,13 @@ + ? STORE_LOCAL(value ex6) + ? JUMP 26 -@@ -795,3 +841,4 @@ +@@ -813,3 +859,4 @@ 170 LOAD_LOCAL(value ex6) - 170 THROW(Throwable) + ? STORE_LOCAL(value ex6) + ? JUMP 26 -@@ -805,2 +852,8 @@ +@@ -823,2 +870,8 @@ + 26: + 169 LOAD_LOCAL(value ex6) @@ -231,7 +231,7 @@ + 169 JUMP 5 + 5: -@@ -815,8 +868,5 @@ +@@ -833,8 +886,5 @@ 180 SCOPE_ENTER value x5 - 180 LOAD_LOCAL(value x5) - 180 CALL_METHOD MyException.message (dynamic) @@ -242,7 +242,7 @@ + ? LOAD_LOCAL(value x5) + 181 CALL_METHOD MyException.message (dynamic) 181 CALL_METHOD scala.Predef.println (dynamic) -@@ -824,5 +874,7 @@ +@@ -842,5 +892,7 @@ 182 DUP(REF(class MyException)) - 182 LOAD_LOCAL(value message) + ? LOAD_LOCAL(value x5) @@ -252,13 +252,13 @@ + ? STORE_LOCAL(variable exc2) + ? JUMP 27 -@@ -830,3 +882,4 @@ +@@ -848,3 +900,4 @@ 169 LOAD_LOCAL(value ex6) - 169 THROW(Throwable) + ? STORE_LOCAL(variable exc2) + ? JUMP 27 -@@ -847,2 +900,15 @@ +@@ -865,2 +918,15 @@ + 27: + 184 LOAD_MODULE object Predef @@ -274,16 +274,16 @@ + 185 THROW(Throwable) + } -@@ -852,6 +918,6 @@ +@@ -870,6 +936,6 @@ with finalizer: null -- catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23) starting at: 4 -+ catch (Throwable) in ArrayBuffer(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4 +- catch (Throwable) in Vector(13, 14, 15, 18, 20, 21, 23) starting at: 4 ++ catch (Throwable) in Vector(13, 14, 15, 18, 20, 21, 23, 25) starting at: 4 consisting of blocks: List(9, 8, 6, 5, 4) with finalizer: null -- catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3 -+ catch (<none>) in ArrayBuffer(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3 +- catch (<none>) in Vector(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23) starting at: 3 ++ catch (<none>) in Vector(4, 5, 6, 9, 13, 14, 15, 18, 20, 21, 23, 25, 26) starting at: 3 consisting of blocks: List(3) -@@ -879,5 +945,5 @@ +@@ -897,5 +963,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, value e, value ex6, value x4, value x5, value message, value x + locals: value args, variable result, value e, value ex6, value x4, value x5, value x @@ -291,7 +291,7 @@ - blocks: [1,2,3,6,7,8,11,13,14,16] + blocks: [1,2,3,6,7,8,11,13,14,16,17] -@@ -905,4 +971,11 @@ +@@ -923,4 +989,11 @@ 124 CALL_METHOD MyException.<init> (static-instance) - 124 THROW(MyException) + ? STORE_LOCAL(value ex6) @@ -304,7 +304,7 @@ + 122 JUMP 7 + 16: -@@ -930,8 +1003,5 @@ +@@ -948,8 +1021,5 @@ 127 SCOPE_ENTER value x5 - 127 LOAD_LOCAL(value x5) - 127 CALL_METHOD MyException.message (dynamic) @@ -315,12 +315,12 @@ + ? LOAD_LOCAL(value x5) + 127 CALL_METHOD MyException.message (dynamic) 127 CALL_METHOD scala.Predef.println (dynamic) -@@ -964,3 +1034,3 @@ +@@ -982,3 +1052,3 @@ with finalizer: null -- catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16) starting at: 3 -+ catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3 +- catch (IllegalArgumentException) in Vector(6, 7, 8, 11, 13, 14, 16) starting at: 3 ++ catch (IllegalArgumentException) in Vector(6, 7, 8, 11, 13, 14, 16, 17) starting at: 3 consisting of blocks: List(3) -@@ -988,5 +1058,5 @@ +@@ -1006,5 +1076,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, value ex6, value x4, value x5, value message, value x, value e + locals: value args, variable result, value ex6, value x4, value x5, value x, value e @@ -328,7 +328,7 @@ - blocks: [1,2,3,4,5,8,12,13,14,16] + blocks: [1,2,3,5,8,12,13,14,16,17] -@@ -1014,4 +1084,13 @@ +@@ -1032,4 +1102,13 @@ 148 CALL_METHOD MyException.<init> (static-instance) - 148 THROW(MyException) + ? STORE_LOCAL(value ex6) @@ -343,13 +343,13 @@ + 154 CZJUMP (BOOL)NE ? 5 : 8 + 16: -@@ -1035,5 +1114,2 @@ +@@ -1053,5 +1132,2 @@ 145 SCOPE_ENTER value x4 - 145 JUMP 4 - - 4: 154 LOAD_LOCAL(value x4) -@@ -1047,8 +1123,5 @@ +@@ -1065,8 +1141,5 @@ 154 SCOPE_ENTER value x5 - 154 LOAD_LOCAL(value x5) - 154 CALL_METHOD MyException.message (dynamic) @@ -360,12 +360,12 @@ + ? LOAD_LOCAL(value x5) + 154 CALL_METHOD MyException.message (dynamic) 154 CALL_METHOD scala.Predef.println (dynamic) -@@ -1269,3 +1342,3 @@ +@@ -1287,3 +1360,3 @@ startBlock: 1 - blocks: [1,2,3,4,5,7] + blocks: [1,2,3,4,5,7,8] -@@ -1293,4 +1366,11 @@ +@@ -1311,4 +1384,11 @@ 38 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance) - 38 THROW(IllegalArgumentException) + ? STORE_LOCAL(value e) @@ -378,7 +378,7 @@ + 42 JUMP 2 + 7: -@@ -1340,5 +1420,5 @@ +@@ -1358,5 +1438,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, value ex6, value x4, value x5, value message, value x + locals: value args, variable result, value ex6, value x4, value x5, value x @@ -386,13 +386,13 @@ - blocks: [1,2,3,4,5,8,10,11,13,14,16] + blocks: [1,2,3,5,8,10,11,13,14,16,17] -@@ -1366,3 +1446,4 @@ +@@ -1384,3 +1464,4 @@ 203 CALL_METHOD MyException.<init> (static-instance) - 203 THROW(MyException) + ? STORE_LOCAL(value ex6) + ? JUMP 17 -@@ -1386,4 +1467,13 @@ +@@ -1404,4 +1485,13 @@ 209 CALL_METHOD MyException.<init> (static-instance) - 209 THROW(MyException) + ? STORE_LOCAL(value ex6) @@ -407,13 +407,13 @@ + 212 CZJUMP (BOOL)NE ? 5 : 8 + 16: -@@ -1399,5 +1489,2 @@ +@@ -1417,5 +1507,2 @@ 200 SCOPE_ENTER value x4 - 200 JUMP 4 - - 4: 212 LOAD_LOCAL(value x4) -@@ -1411,8 +1498,5 @@ +@@ -1429,8 +1516,5 @@ 212 SCOPE_ENTER value x5 - 212 LOAD_LOCAL(value x5) - 212 CALL_METHOD MyException.message (dynamic) @@ -424,12 +424,12 @@ + ? LOAD_LOCAL(value x5) + 213 CALL_METHOD MyException.message (dynamic) 213 CALL_METHOD scala.Predef.println (dynamic) -@@ -1460,3 +1544,3 @@ +@@ -1478,3 +1562,3 @@ startBlock: 1 - blocks: [1,2,3,4,5,7] + blocks: [1,2,3,4,5,7,8] -@@ -1484,4 +1568,11 @@ +@@ -1502,4 +1586,11 @@ 58 CALL_METHOD java.lang.IllegalArgumentException.<init> (static-instance) - 58 THROW(IllegalArgumentException) + ? STORE_LOCAL(value e) @@ -442,12 +442,12 @@ + 62 JUMP 2 + 7: -@@ -1533,3 +1624,3 @@ +@@ -1551,3 +1642,3 @@ startBlock: 1 - blocks: [1,3,4] + blocks: [1,3,4,5] -@@ -1553,4 +1644,9 @@ +@@ -1571,4 +1662,9 @@ 229 CALL_METHOD MyException.<init> (static-instance) - 229 THROW(MyException) + ? JUMP 5 @@ -458,12 +458,12 @@ + 228 THROW(Throwable) + 3: -@@ -1559,3 +1655,3 @@ +@@ -1577,3 +1673,3 @@ 228 MONITOR_EXIT - ? THROW(Throwable) + 228 THROW(Throwable) -@@ -1587,5 +1683,5 @@ +@@ -1605,5 +1701,5 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, variable result, variable monitor2, variable monitorResult1 + locals: value exception$1, value args, variable result, variable monitor2, variable monitorResult1 @@ -471,7 +471,7 @@ - blocks: [1,3,4] + blocks: [1,3,4,5] -@@ -1612,4 +1708,12 @@ +@@ -1630,4 +1726,12 @@ 245 CALL_METHOD MyException.<init> (static-instance) - 245 THROW(MyException) + ? STORE_LOCAL(value exception$1) @@ -485,7 +485,7 @@ + 244 THROW(Throwable) + 3: -@@ -1618,3 +1722,3 @@ +@@ -1636,3 +1740,3 @@ 244 MONITOR_EXIT - ? THROW(Throwable) + 244 THROW(Throwable) diff --git a/test/files/run/inline-ex-handlers.scala b/test/files/run/inline-ex-handlers.scala index 964594d258..4095d54e36 100644 --- a/test/files/run/inline-ex-handlers.scala +++ b/test/files/run/inline-ex-handlers.scala @@ -1,7 +1,7 @@ import scala.tools.partest.IcodeComparison object Test extends IcodeComparison { - override def printIcodeAfterPhase = "inlinehandlers" + override def printIcodeAfterPhase = "inlinehandlers"; override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" // same line to minimize check file changs } import scala.util.Random._ diff --git a/test/files/run/large_class.check b/test/files/run/large_class.check index 0585c267ac..babe24db94 100644 --- a/test/files/run/large_class.check +++ b/test/files/run/large_class.check @@ -1,3 +1 @@ -newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large! -class BigEnoughToFail { - ^ +error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Class file too large! diff --git a/test/files/run/large_code.check b/test/files/run/large_code.check index 6ad50967bc..42bf490942 100644 --- a/test/files/run/large_code.check +++ b/test/files/run/large_code.check @@ -1,3 +1 @@ -newSource1.scala:1: error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large! -class BigEnoughToFail { - ^ +error: Could not write class BigEnoughToFail because it exceeds JVM code size limits. Method tooLong's code too large! diff --git a/test/files/run/lub-visibility.check b/test/files/run/lub-visibility.check index 757f0f5917..61dca979a1 100644 --- a/test/files/run/lub-visibility.check +++ b/test/files/run/lub-visibility.check @@ -4,6 +4,6 @@ scala> // should infer List[scala.collection.immutable.Seq[Nothing]] scala> // but reverted that for SI-5534. scala> val x = List(List(), Vector()) -x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable] = List(List(), Vector()) +x: List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with Serializable] = List(List(), Vector()) scala> :quit diff --git a/test/files/run/nothingTypeDce.flags b/test/files/run/nothingTypeDce.flags index d85321ca0e..fde52cc7df 100644 --- a/test/files/run/nothingTypeDce.flags +++ b/test/files/run/nothingTypeDce.flags @@ -1 +1 @@ --target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code +-Ybackend:GenBCode -Yopt:unreachable-code diff --git a/test/files/run/nothingTypeDce.scala b/test/files/run/nothingTypeDce.scala index 5f3692fd33..92d3ca6f89 100644 --- a/test/files/run/nothingTypeDce.scala +++ b/test/files/run/nothingTypeDce.scala @@ -1,7 +1,6 @@ // See comment in BCodeBodyBuilder -// -target:jvm-1.6 -Ybackend:GenBCode -Yopt:unreachable-code -// target enables stack map frames generation +// -Ybackend:GenBCode -Yopt:unreachable-code class C { // can't just emit a call to ???, that returns value of type Nothing$ (not Int). diff --git a/test/files/run/nothingTypeNoFramesNoDce.check b/test/files/run/nothingTypeNoFramesNoDce.check deleted file mode 100644 index b1d08b45ff..0000000000 --- a/test/files/run/nothingTypeNoFramesNoDce.check +++ /dev/null @@ -1 +0,0 @@ -warning: -target:jvm-1.5 is deprecated: use target for Java 1.6 or above. diff --git a/test/files/run/nothingTypeNoFramesNoDce.flags b/test/files/run/nothingTypeNoFramesNoDce.flags deleted file mode 100644 index a035c86179..0000000000 --- a/test/files/run/nothingTypeNoFramesNoDce.flags +++ /dev/null @@ -1 +0,0 @@ --target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -deprecation diff --git a/test/files/run/nothingTypeNoFramesNoDce.scala b/test/files/run/nothingTypeNoFramesNoDce.scala deleted file mode 100644 index 7f63faeaa7..0000000000 --- a/test/files/run/nothingTypeNoFramesNoDce.scala +++ /dev/null @@ -1,61 +0,0 @@ -// See comment in BCodeBodyBuilder - -// -target:jvm-1.5 -Ybackend:GenBCode -Yopt:l:none -// target disables stack map frame generation. in this mode, the ClssWriter just emits dead code as is. - -class C { - // can't just emit a call to ???, that returns value of type Nothing$ (not Int). - def f1: Int = ??? - - def f2: Int = throw new Error("") - - def f3(x: Boolean) = { - var y = 0 - // cannot assign an object of type Nothing$ to Int - if (x) y = ??? - else y = 1 - y - } - - def f4(x: Boolean) = { - var y = 0 - // tests that whatever is emitted after the throw is valid (what? depends on opts, presence of stack map frames) - if (x) y = throw new Error("") - else y = 1 - y - } - - def f5(x: Boolean) = { - // stack heights need to be the same. ??? looks to the jvm like returning a value of - // type Nothing$, need to drop or throw it. - println( - if (x) { ???; 10 } - else 20 - ) - } - - def f6(x: Boolean) = { - println( - if (x) { throw new Error(""); 10 } - else 20 - ) - } - - def f7(x: Boolean) = { - println( - if (x) throw new Error("") - else 20 - ) - } - - def f8(x: Boolean) = { - println( - if (x) throw new Error("") - else 20 - ) - } -} - -object Test extends App { - new C() -} diff --git a/test/files/run/nothingTypeNoOpt.flags b/test/files/run/nothingTypeNoOpt.flags index b3b518051b..d3e4d61e19 100644 --- a/test/files/run/nothingTypeNoOpt.flags +++ b/test/files/run/nothingTypeNoOpt.flags @@ -1 +1 @@ --target:jvm-1.6 -Ybackend:GenBCode -Yopt:l:none +-Ybackend:GenBCode -Yopt:l:none 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/repl-javap-app.check b/test/files/run/repl-javap-app.check deleted file mode 100644 index bace9534da..0000000000 --- a/test/files/run/repl-javap-app.check +++ /dev/null @@ -1,60 +0,0 @@ -#partest java6 -Welcome to Scala -Type in expressions for evaluation. Or try :help. - -scala> :javap -app MyApp$ -public final void delayedEndpoint$MyApp$1(); - Code: - Stack=2, Locals=1, Args_size=1 - 0: getstatic #XX; //Field scala/Console$.MODULE$:Lscala/Console$; - 3: ldc #XX; //String Hello, delayed world. - 5: invokevirtual #XX; //Method scala/Console$.println:(Ljava/lang/Object;)V - 8: return - LocalVariableTable: - Start Length Slot Name Signature - 0 9 0 this LMyApp$; - -scala> :quit -#partest java7 -Welcome to Scala -Type in expressions for evaluation. Or try :help. - -scala> :javap -app MyApp$ - public final void delayedEndpoint$MyApp$1(); - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=2, locals=1, args_size=1 - 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$; - 3: ldc #XX // String Hello, delayed world. - 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V - 8: return - LocalVariableTable: - Start Length Slot Name Signature - 0 9 0 this LMyApp$; - LineNumberTable: - line 5: 0 -} - -scala> :quit -#partest java8 -Welcome to Scala -Type in expressions for evaluation. Or try :help. - -scala> :javap -app MyApp$ - public final void delayedEndpoint$MyApp$1(); - descriptor: ()V - flags: ACC_PUBLIC, ACC_FINAL - Code: - stack=2, locals=1, args_size=1 - 0: getstatic #XX // Field scala/Console$.MODULE$:Lscala/Console$; - 3: ldc #XX // String Hello, delayed world. - 5: invokevirtual #XX // Method scala/Console$.println:(Ljava/lang/Object;)V - 8: return - LocalVariableTable: - Start Length Slot Name Signature - 0 9 0 this LMyApp$; - LineNumberTable: - line 5: 0 -} - -scala> :quit diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala deleted file mode 100644 index ad6076c2d5..0000000000 --- a/test/files/run/repl-javap-app.scala +++ /dev/null @@ -1,21 +0,0 @@ - -import scala.tools.partest.ReplTest - -object MyApp extends App { - Console println "Hello, delayed world." -} - -object Test extends ReplTest { - def code = ":javap -app MyApp$" - - override def welcoming = true - - // The constant pool indices are not the same for GenASM / GenBCode, so - // replacing the exact numbers by XX. - lazy val hasConstantPoolRef = """(.*)(#\d\d)(.*)""".r - - override def normalize(s: String) = s match { - case hasConstantPoolRef(start, ref, end) => start + "#XX" + end - case _ => super.normalize(s) - } -} diff --git a/test/files/run/repl-javap-def.scala b/test/files/run/repl-javap-def.scala index dbd769613a..3994f06767 100644 --- a/test/files/run/repl-javap-def.scala +++ b/test/files/run/repl-javap-def.scala @@ -3,7 +3,7 @@ import scala.tools.partest.JavapTest object Test extends JavapTest { def code = """ |def f = 7 - |:javap -public -raw f + |:javap -public f """.stripMargin // it should find f wrapped in repl skins. replstiltskin. diff --git a/test/files/run/repl-javap-fun.scala b/test/files/run/repl-javap-fun.scala deleted file mode 100644 index 5c9a6b7691..0000000000 --- a/test/files/run/repl-javap-fun.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.tools.partest.JavapTest - -object Test extends JavapTest { - def code = """ - |object Betty { - | List(1,2,3) filter (_ % 2 != 0) map (_ * 2) - |} - |:javap -fun Betty - """.stripMargin - - // two anonfuns of Betty - override def yah(res: Seq[String]) = { - def filtered = res filter (_ contains "public final class Betty") - 2 == filtered.size - } -} diff --git a/test/files/run/repl-javap-lambdas.scala b/test/files/run/repl-javap-lambdas.scala deleted file mode 100644 index 76a6ec8450..0000000000 --- a/test/files/run/repl-javap-lambdas.scala +++ /dev/null @@ -1,23 +0,0 @@ -import scala.tools.partest.JavapTest -import scala.tools.nsc.Settings - -// see repl-javap-memfun.java for the complementary version -object Test extends JavapTest { - override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "method" ; s } - def code = """ - |object Betty { - | List(1,2,3) count (_ % 2 != 0) - | def f = List(1,2,3) filter ((x: Any) => true) map (x => "m1") - | def g = List(1,2,3) filter ((x: Any) => true) map (x => "m1") map (x => "m2") - |} - |:javap -fun Betty#g - """.stripMargin - - // three anonfuns of Betty#g - override def yah(res: Seq[String]) = { - import PartialFunction.{ cond => when } - val r = """.*final .* .*\$anonfun\$\d+\(.*""".r - def filtered = res filter (when(_) { case r(_*) => true }) - 3 == filtered.size - } -} diff --git a/test/files/run/repl-javap-memfun.scala b/test/files/run/repl-javap-memfun.scala deleted file mode 100644 index d10ebcb399..0000000000 --- a/test/files/run/repl-javap-memfun.scala +++ /dev/null @@ -1,22 +0,0 @@ -import scala.tools.partest.JavapTest -import scala.tools.nsc.Settings - -// see repl-javap-lambdas.scala for the complementary version -object Test extends JavapTest { - // asserting the default - override def transformSettings(s: Settings) = { s.Ydelambdafy.value = "inline" ; s } - def code = """ - |object Betty { - | List(1,2,3) count (_ % 2 != 0) - | def f = List(1,2,3) filter (_ % 2 != 0) map (_ * 2) - | def g = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) map (_ + 1) - |} - |:javap -fun Betty#g - """.stripMargin - - // three anonfuns of Betty#g - override def yah(res: Seq[String]) = { - def filtered = res filter (_ contains "public final class Betty") - 3 == filtered.size - } -} diff --git a/test/files/run/repl-javap-more-fun.scala b/test/files/run/repl-javap-more-fun.scala deleted file mode 100644 index e603faf75a..0000000000 --- a/test/files/run/repl-javap-more-fun.scala +++ /dev/null @@ -1,17 +0,0 @@ -import scala.tools.partest.JavapTest - -object Test extends JavapTest { - def code = """ - |object Betty { - | val ds = List(1,2,3) filter (_ % 2 == 0) map (_ * 3) - | def m(vs: List[Int]) = vs filter (_ % 2 != 0) map (_ * 2) - |} - |:javap -fun Betty - """.stripMargin - - // two anonfuns of Betty - override def yah(res: Seq[String]) = { - def filtered = res filter (_ contains "public final class Betty") - 4 == filtered.size - } -} diff --git a/test/files/run/repl-javap-outdir-funs.flags b/test/files/run/repl-javap-outdir-funs.flags deleted file mode 100644 index ac96850b69..0000000000 --- a/test/files/run/repl-javap-outdir-funs.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline
\ No newline at end of file diff --git a/test/files/run/repl-javap-outdir-funs/foo_1.scala b/test/files/run/repl-javap-outdir-funs/foo_1.scala deleted file mode 100644 index 9b98e94733..0000000000 --- a/test/files/run/repl-javap-outdir-funs/foo_1.scala +++ /dev/null @@ -1,6 +0,0 @@ - -package disktest - -class Foo { - def m(vs: List[Int]) = vs map (_ + 1) -} diff --git a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala b/test/files/run/repl-javap-outdir-funs/run-repl_7.scala deleted file mode 100644 index af9651a8a3..0000000000 --- a/test/files/run/repl-javap-outdir-funs/run-repl_7.scala +++ /dev/null @@ -1,20 +0,0 @@ -import scala.tools.partest.JavapTest - -object Test extends JavapTest { - // note the '-fun': it makes :javap search for some anonfun. - // for that reason, this test has a flags file that forces delambdafy:inline (doesn't allow :method) - def code = """ - |:javap -fun disktest/Foo.class - """.stripMargin - - override def yah(res: Seq[String]) = - // It's currently unknown why this test fails on Avian with - // “Failed: No anonfuns found.”, skip it for now. See SI-7630. - if (scala.tools.partest.utils.Properties.isAvian) - true - else { - val r = "public final class disktest.Foo.*extends scala.runtime.AbstractFunction1".r - def filtered = res filter (r.findFirstIn(_).nonEmpty) - 1 == filtered.size - } -} diff --git a/test/files/run/repl-javap.scala b/test/files/run/repl-javap.scala index 7a19852d4e..25e72f3b13 100644 --- a/test/files/run/repl-javap.scala +++ b/test/files/run/repl-javap.scala @@ -7,7 +7,8 @@ object Test extends JavapTest { """.stripMargin override def yah(res: Seq[String]) = { - def filtered = res filter (_ contains "public class Betty") + val r = """public class \S*Betty""".r.unanchored + def filtered = res filter { case r(_*) => true ; case _ => false } 1 == filtered.size } } 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/scalapInvokedynamic.check b/test/files/run/scalapInvokedynamic.check new file mode 100644 index 0000000000..8e4b08f234 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.check @@ -0,0 +1,5 @@ +class C extends scala.AnyRef { + def this() = { /* compiled code */ } + def m: java.lang.String = { /* compiled code */ } +} + diff --git a/test/files/run/scalapInvokedynamic.scala b/test/files/run/scalapInvokedynamic.scala new file mode 100644 index 0000000000..670cf26662 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.scala @@ -0,0 +1,11 @@ +class C { + def m = { + val f = (x: String) => x.trim + f(" H ae i ") + } +} + +object Test extends App { + val testClassesDir = System.getProperty("partest.output") + scala.tools.scalap.Main.main(Array("-cp", testClassesDir, "C")) +}
\ No newline at end of file diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check index 66a0e707b3..c6457216b5 100644 --- a/test/files/run/t2106.check +++ b/test/files/run/t2106.check @@ -1,10 +1,10 @@ -#partest -Ybackend:GenBCode +#partest !-Ybackend:GenASM t2106.scala:7: warning: A::foo()Ljava/lang/Object; is annotated @inline but could not be inlined: The callee A::foo()Ljava/lang/Object; contains the instruction INVOKEVIRTUAL java/lang/Object.clone ()Ljava/lang/Object; that would cause an IllegalAccessError when inlined into class Test$. def main(args: Array[String]): Unit = x.foo ^ -#partest !-Ybackend:GenBCode +#partest -Ybackend:GenASM t2106.scala:7: warning: Could not inline required method foo because access level required by callee not matched by caller. def main(args: Array[String]): Unit = x.foo ^ diff --git a/test/files/run/t2251b.check b/test/files/run/t2251b.check index 4231fc6ea6..b60698d605 100644 --- a/test/files/run/t2251b.check +++ b/test/files/run/t2251b.check @@ -1,4 +1,4 @@ -TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with java.io.Serializable]] +TypeTag[List[scala.collection.immutable.LinearSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]] TypeTag[List[scala.collection.immutable.Iterable[B[_ >: F with E with D with C <: B[_ >: F with E with D with C <: A]]] with F with Int => Any]] TypeTag[List[scala.collection.immutable.Seq[B[_ >: D with C <: B[_ >: D with C <: A]]] with scala.collection.AbstractSeq[B[_ >: D with C <: B[_ >: D with C <: A]]] with Serializable]] TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]] @@ -6,6 +6,6 @@ TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G w TypeTag[List[scala.collection.Set[_ >: G with F <: B[_ >: G with F <: B[_ >: G with F <: A]]]]] TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] TypeTag[List[scala.collection.Map[_ >: F with C <: B[_ >: F with C <: B[_ >: F with C <: A]], B[_ >: G with D <: B[_ >: G with D <: A]]]]] -TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with java.io.Serializable]] +TypeTag[List[scala.collection.AbstractSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with scala.collection.LinearSeq[B[_ >: G with F <: B[_ >: G with F <: A]]] with Serializable]] TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] TypeTag[List[Seq[B[_ >: G with F <: B[_ >: G with F <: A]]]]] 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/t4332.scala b/test/files/run/t4332.scala index 5a67922911..1c7e7d73de 100644 --- a/test/files/run/t4332.scala +++ b/test/files/run/t4332.scala @@ -12,7 +12,7 @@ object Test extends DirectTest { } def isExempt(sym: Symbol) = { - val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform") + val exempt = Set("view", "repr", "sliceWithKnownDelta", "sliceWithKnownBound", "transform", "filterImpl") (exempt contains sym.name.decoded) } diff --git a/test/files/run/t5313.scala b/test/files/run/t5313.scala index 7f5af74c3f..24ed334816 100644 --- a/test/files/run/t5313.scala +++ b/test/files/run/t5313.scala @@ -3,7 +3,7 @@ import scala.tools.partest.IcodeComparison object Test extends IcodeComparison { override def printIcodeAfterPhase = "dce" - override def extraSettings: String = super.extraSettings + " -optimize" + override def extraSettings: String = super.extraSettings + " -optimize -Ybackend:GenASM" override def code = """class Foo { 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/t6102.check b/test/files/run/t6102.check index 07378f5ed4..395864f57c 100644 --- a/test/files/run/t6102.check +++ b/test/files/run/t6102.check @@ -28,9 +28,9 @@ [running phase constopt on t6102.scala] #partest [running phase dce on t6102.scala] -#partest !-Ybackend:GenBCode +#partest -Ybackend:GenASM [running phase jvm on icode] -#partest -Ybackend:GenBCode +#partest !-Ybackend:GenASM [running phase jvm on t6102.scala] [running phase jvm on t6102.scala] #partest 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 78e9b27371..388f6690d6 100644 --- a/test/files/run/t6260c.check +++ b/test/files/run/t6260c.check @@ -1,9 +1,5 @@ f(C@2e) -#partest !-Ydelambdafy:method -Test$$anonfun$$apply -#partest -Ydelambdafy:method -Test$lambda$1$$apply -#partest apply +writeReplace g(C@2e) diff --git a/test/files/run/t6288b-jump-position.check b/test/files/run/t6288b-jump-position.check deleted file mode 100644 index ece88b18f0..0000000000 --- a/test/files/run/t6288b-jump-position.check +++ /dev/null @@ -1,76 +0,0 @@ -object Case3 extends Object { - // fields: - - // methods - def unapply(z: Object (REF(class Object))): Option { - locals: value z - startBlock: 1 - blocks: [1] - - 1: - 2 NEW REF(class Some) - 2 DUP(REF(class Some)) - 2 CONSTANT(-1) - 2 BOX INT - 2 CALL_METHOD scala.Some.<init> (static-instance) - 2 RETURN(REF(class Option)) - - } - Exception handlers: - - def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, value x1, value x - startBlock: 1 - blocks: [1,2,3,6,7] - - 1: - 4 CONSTANT("") - 4 STORE_LOCAL(value x1) - 4 SCOPE_ENTER value x1 - 4 JUMP 2 - - 2: - 5 LOAD_LOCAL(value x1) - 5 IS_INSTANCE REF(class String) - 5 CZJUMP (BOOL)NE ? 3 : 6 - - 3: - 6 LOAD_MODULE object Predef - 6 CONSTANT("case 0") - 6 CALL_METHOD scala.Predef.println (dynamic) - 6 LOAD_FIELD scala.runtime.BoxedUnit.UNIT - 6 STORE_LOCAL(value x) - 6 JUMP 7 - - 6: - 8 LOAD_MODULE object Predef - 8 CONSTANT("default") - 8 CALL_METHOD scala.Predef.println (dynamic) - 8 LOAD_FIELD scala.runtime.BoxedUnit.UNIT - 8 STORE_LOCAL(value x) - 8 JUMP 7 - - 7: - 10 LOAD_MODULE object Predef - 10 CONSTANT("done") - 10 CALL_METHOD scala.Predef.println (dynamic) - 10 RETURN(UNIT) - - } - Exception handlers: - - def <init>(): Case3.type { - locals: - startBlock: 1 - blocks: [1] - - 1: - 12 THIS(Case3) - 12 CALL_METHOD java.lang.Object.<init> (super()) - 12 RETURN(UNIT) - - } - Exception handlers: - - -} diff --git a/test/files/run/t6288b-jump-position.scala b/test/files/run/t6288b-jump-position.scala deleted file mode 100644 index c5f3bbe788..0000000000 --- a/test/files/run/t6288b-jump-position.scala +++ /dev/null @@ -1,19 +0,0 @@ -import scala.tools.partest.IcodeComparison - -object Test extends IcodeComparison { - override def code = - """object Case3 { // 01 - | def unapply(z: Any): Option[Int] = Some(-1) // 02 - | def main(args: Array[String]) { // 03 - | ("": Any) match { // 04 - | case x : String => // 05 Read: <linenumber> JUMP <target basic block id> - | println("case 0") // 06 expecting "6 JUMP 7", was "8 JUMP 7" - | case _ => // 07 - | println("default") // 08 expecting "8 JUMP 7" - | } // 09 - | println("done") // 10 - | } - |}""".stripMargin - - override def show() = showIcode() -} 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/t6827.check b/test/files/run/t6827.check index 3a3a71c67d..4889e05be8 100644 --- a/test/files/run/t6827.check +++ b/test/files/run/t6827.check @@ -1,6 +1,6 @@ -start at -5: java.lang.IllegalArgumentException: requirement failed: start -5 out of range 10 -start at -1: java.lang.IllegalArgumentException: requirement failed: start -1 out of range 10 -start at limit: java.lang.IllegalArgumentException: requirement failed: start 10 out of range 10 +start at -5: java.lang.ArrayIndexOutOfBoundsException: -5 +start at -1: java.lang.ArrayIndexOutOfBoundsException: -1 +start at limit: ok start at limit-1: ok first 10: ok read all: ok @@ -8,8 +8,8 @@ test huge len: ok 5 from 5: ok 20 from 5: ok test len overflow: ok -start beyond limit: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +start beyond limit: ok read 0: ok read -1: ok -invalid read 0: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 -invalid read -1: java.lang.IllegalArgumentException: requirement failed: start 30 out of range 10 +invalid read 0: ok +invalid read -1: ok diff --git a/test/files/run/t6827.scala b/test/files/run/t6827.scala index 8e17af09e2..eb020711bb 100644 --- a/test/files/run/t6827.scala +++ b/test/files/run/t6827.scala @@ -31,4 +31,24 @@ object Test extends App { // okay, see SI-7128 "...".toIterator.copyToArray(new Array[Char](0), 0, 0) + + + // Bonus test from @som-snytt to check for overflow in + // index calculations. + def testOverflow(start: Int, len: Int, expected: List[Char]) { + def copyFromIterator = { + val arr = Array.fill[Char](3)('-') + "abc".toIterator.copyToArray(arr, start, len) + arr.toList + } + def copyFromArray = { + val arr = Array.fill[Char](3)('-') + "abc".toArray.copyToArray(arr, start, len) + arr.toList + } + assert(copyFromIterator == expected) + assert(copyFromArray == expected) + } + testOverflow(1, Int.MaxValue - 1, "-ab".toList) + testOverflow(1, Int.MaxValue, "-ab".toList) } diff --git a/test/files/run/t6955.scala b/test/files/run/t6955.scala index 329af688e4..9ee3ef6bc5 100644 --- a/test/files/run/t6955.scala +++ b/test/files/run/t6955.scala @@ -21,6 +21,8 @@ class Switches { } object Test extends IcodeComparison { + override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" + // ensure we get two switches out of this -- ignore the rest of the output for robustness // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file) override def show() = { diff --git a/test/files/run/t6956.scala b/test/files/run/t6956.scala index 3569adf483..594f5c9194 100644 --- a/test/files/run/t6956.scala +++ b/test/files/run/t6956.scala @@ -19,6 +19,8 @@ class Switches { } object Test extends IcodeComparison { + override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" + // ensure we get two switches out of this -- ignore the rest of the output for robustness // exclude the constant we emit for the "SWITCH ..." string below (we get the icode for all the code you see in this file) override def show() = { 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/t7521/Test.scala b/test/files/run/t7521/Test.scala new file mode 100644 index 0000000000..e9816ad6cb --- /dev/null +++ b/test/files/run/t7521/Test.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + new Wrapper(new Array[Int](1)) + } +} diff --git a/test/files/run/t7521/Wrapper.scala b/test/files/run/t7521/Wrapper.scala new file mode 100644 index 0000000000..0b923f8924 --- /dev/null +++ b/test/files/run/t7521/Wrapper.scala @@ -0,0 +1 @@ +class Wrapper[Repr](val xs: Repr) extends AnyVal diff --git a/test/files/run/t7521b.check b/test/files/run/t7521b.check new file mode 100644 index 0000000000..4d96df106d --- /dev/null +++ b/test/files/run/t7521b.check @@ -0,0 +1,7 @@ += Java Erased Signatures = +public int C.a(Wrapper) +public int C.b(Wrapper) + += Java Generic Signatures = +public int C.a(Wrapper<int[]>) +public int C.b(Wrapper<java.lang.Object>) diff --git a/test/files/run/t7521b.scala b/test/files/run/t7521b.scala new file mode 100644 index 0000000000..c9e27f28b4 --- /dev/null +++ b/test/files/run/t7521b.scala @@ -0,0 +1,20 @@ +class Wrapper[X](x: X) + +class C { + def a(w: Wrapper[Array[Int]]) = 0 + def b(w: Wrapper[Int]) = 0 +} + +object Test { + def main(args: Array[String]): Unit = { + val c = new C + c.a(new Wrapper(Array(1, 2))) + c.b(new Wrapper(1)) + + val methods = classOf[C].getDeclaredMethods.sortBy(_.getName) + println("= Java Erased Signatures =") + println(methods.mkString("\n")) + println("\n= Java Generic Signatures =") + println(methods.map(_.toGenericString).mkString("\n")) + } +} 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/t7775.scala b/test/files/run/t7775.scala index 48b0d89974..bc69064e17 100644 --- a/test/files/run/t7775.scala +++ b/test/files/run/t7775.scala @@ -1,3 +1,45 @@ +import scala.concurrent._, duration._ +import ExecutionContext.Implicits.global +import scala.tools.reflect.WrappedProperties.AccessControl._ +import java.util.concurrent.CyclicBarrier + +object Test extends App { + @volatile var done = false + val barrier = new CyclicBarrier(2) + + val probe = Future { + val attempts = 1024 // previously, failed after a few + def fail(i: Int) = s"Failed at $i" + barrier.await() + for (i <- 1 to attempts ; p <- systemProperties) + p match { case (k, v) => assert (k != null && v != null, fail(i)) } + } + probe onComplete { + case _ => done = true + } + + System.setProperty("foo", "fooz") + System.setProperty("bar", "barz") + barrier.await() // just for fun, wait to start mucking with properties + + // continually modify properties trying to break live iteration over sys props + // hint: don't iterate lively over sys props + var alt = true + while (!done) { + if (alt) { + System.getProperties.remove("foo") + System.setProperty("bar", "barz") + alt = false + } else { + System.getProperties.remove("bar") + System.setProperty("foo", "fooz") + alt = true + } + } + Await.result(probe, Duration.Inf) +} + +/* import scala.concurrent.{duration, Future, Await, ExecutionContext} import scala.tools.nsc.Settings import ExecutionContext.Implicits.global @@ -15,3 +57,4 @@ object Test { Await.result(compiler, duration.Duration.Inf) } } +*/ diff --git a/test/files/run/t8549.scala b/test/files/run/t8549.scala index cb254e3810..da1a9d58c1 100644 --- a/test/files/run/t8549.scala +++ b/test/files/run/t8549.scala @@ -79,7 +79,7 @@ object Test extends App { } } - // Generated on 20141010-14:01:28 with Scala version 2.11.2) + // Generated on 20150519-10:11:14 with Scala version 2.12.0-20150517-213212-4c1ce60ef9) overwrite.foreach(updateComment) check(Some(1))("rO0ABXNyAApzY2FsYS5Tb21lESLyaV6hi3QCAAFMAAF4dAASTGphdmEvbGFuZy9PYmplY3Q7eHIADHNjYWxhLk9wdGlvbv5pN/3bDmZ0AgAAeHBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAQ==") @@ -163,6 +163,9 @@ object Test extends App { check(mutable.HashMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAAAAAAABAB4") check(mutable.HashMap(1 -> 1))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXEAfgAEeA==") check(mutable.HashSet(1, 2, 3))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGFzaFNldAAAAAAAAAABAwAAeHB3DQAAAcIAAAADAAAABQBzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJzcQB+AAIAAAADeA==") + check(mutable.TreeMap())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAABw") + check(mutable.TreeMap(1 -> 1, 3 -> 6))( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcNx8qC229ZvwAgACTAAIb3JkZXJpbmd0ABVMc2NhbGEvbWF0aC9PcmRlcmluZztMACZzY2FsYSRjb2xsZWN0aW9uJG11dGFibGUkVHJlZU1hcCQkdHJlZXQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJFRyZWU7eHBzcgAYc2NhbGEubWF0aC5PcmRlcmluZyRJbnQkC4BMdr1Z51wCAAB4cHNyACpzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuUmVkQmxhY2tUcmVlJFRyZWUATKc08DWmFQIAAkkABHNpemVMAARyb290dAAsTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9SZWRCbGFja1RyZWUkTm9kZTt4cAAAAAJzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSROb2RlGxHsFtValgACAAZaAANyZWRMAANrZXl0ABJMamF2YS9sYW5nL09iamVjdDtMAARsZWZ0cQB+AAdMAAZwYXJlbnRxAH4AB0wABXJpZ2h0cQB+AAdMAAV2YWx1ZXEAfgAKeHAAc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhyABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAAAFwcHNxAH4ACQFzcQB+AAwAAAADcHEAfgALcHNxAH4ADAAAAAZxAH4ADg==") + check(mutable.TreeMap(1 -> 1, 3 -> 6).range(1, 2))( "rO0ABXNyACxzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuVHJlZU1hcCRUcmVlTWFwVmlldx7MCZxLhVQ8AgADTAAGJG91dGVydAAiTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9UcmVlTWFwO0wABGZyb210AA5Mc2NhbGEvT3B0aW9uO0wABXVudGlscQB+AAJ4cgAgc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlRyZWVNYXDcfKgttvWb8AIAAkwACG9yZGVyaW5ndAAVTHNjYWxhL21hdGgvT3JkZXJpbmc7TAAmc2NhbGEkY29sbGVjdGlvbiRtdXRhYmxlJFRyZWVNYXAkJHRyZWV0ACxMc2NhbGEvY29sbGVjdGlvbi9tdXRhYmxlL1JlZEJsYWNrVHJlZSRUcmVlO3hwc3IAGHNjYWxhLm1hdGguT3JkZXJpbmckSW50JAuATHa9WedcAgAAeHBzcgAqc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLlJlZEJsYWNrVHJlZSRUcmVlAEynNPA1phUCAAJJAARzaXplTAAEcm9vdHQALExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUmVkQmxhY2tUcmVlJE5vZGU7eHAAAAACc3IAKnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5SZWRCbGFja1RyZWUkTm9kZRsR7BbVWpYAAgAGWgADcmVkTAADa2V5dAASTGphdmEvbGFuZy9PYmplY3Q7TAAEbGVmdHEAfgAKTAAGcGFyZW50cQB+AApMAAVyaWdodHEAfgAKTAAFdmFsdWVxAH4ADXhwAHNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAABcHBzcQB+AAwBc3EAfgAPAAAAA3BxAH4ADnBzcQB+AA8AAAAGcQB+ABFzcQB+AANxAH4ACHEAfgALc3IACnNjYWxhLlNvbWURIvJpXqGLdAIAAUwAAXhxAH4ADXhyAAxzY2FsYS5PcHRpb27+aTf92w5mdAIAAHhwcQB+ABFzcQB+ABZzcQB+AA8AAAAC") // TODO SI-8576 Uninitialized field under -Xcheckinit // check(new mutable.History())( "rO0ABXNyACBzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuSGlzdG9yeUhuXxDIFJrsAgACSQAKbWF4SGlzdG9yeUwAA2xvZ3QAIExzY2FsYS9jb2xsZWN0aW9uL211dGFibGUvUXVldWU7eHAAAAPoc3IAHnNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5RdWV1ZbjMURVfOuHHAgAAeHIAJHNjYWxhLmNvbGxlY3Rpb24ubXV0YWJsZS5NdXRhYmxlTGlzdFJpnjJ+gFbAAgADSQADbGVuTAAGZmlyc3QwdAAlTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9MaW5rZWRMaXN0O0wABWxhc3QwcQB+AAV4cAAAAABzcgAjc2NhbGEuY29sbGVjdGlvbi5tdXRhYmxlLkxpbmtlZExpc3Sak+nGCZHaUQIAAkwABGVsZW10ABJMamF2YS9sYW5nL09iamVjdDtMAARuZXh0dAAeTHNjYWxhL2NvbGxlY3Rpb24vbXV0YWJsZS9TZXE7eHBwcQB+AApxAH4ACg==") check(mutable.LinkedHashMap(1 -> 2))( "rO0ABXNyACZzY2FsYS5jb2xsZWN0aW9uLm11dGFibGUuTGlua2VkSGFzaE1hcAAAAAAAAAABAwAAeHB3DQAAAu4AAAABAAAABABzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIAAHhwAAAAAXNxAH4AAgAAAAJ4") diff --git a/test/files/run/t8575.scala b/test/files/run/t8575.scala new file mode 100644 index 0000000000..fb8f603f3e --- /dev/null +++ b/test/files/run/t8575.scala @@ -0,0 +1,32 @@ +class E[F] +class A +class B +class C + +trait TypeMember { + type X + + // This call throws an AbstractMethodError, because it invokes the erasure of + // consume(X): Unit that is consume(Object): Unit. But the corresponding + // bridge method is not generated. + consume(value) + + def value: X + def consume(x: X): Unit +} + +object Test extends TypeMember { + type F = A with B + + // works if replaced by type X = E[A with B with C] + type X = E[F with C] + + def value = new E[F with C] + + // This call passes, since it invokes consume(E): Unit + def consume(x: X) {} + + def main(args: Array[String]) { + consume(value) + } +} diff --git a/test/files/run/t8575b.scala b/test/files/run/t8575b.scala new file mode 100644 index 0000000000..0d731ccf9f --- /dev/null +++ b/test/files/run/t8575b.scala @@ -0,0 +1,17 @@ +class A +class B +class C + +object Test { + type F = A with B + + def main(args: Array[String]) { + import reflect.runtime.universe._ + val t1 = typeOf[F with C] + val t2 = typeOf[(A with B) with C] + val t3 = typeOf[A with B with C] + assert(t1 =:= t2) + assert(t2 =:= t3) + assert(t3 =:= t1) + } +} diff --git a/test/files/run/t8575c.scala b/test/files/run/t8575c.scala new file mode 100644 index 0000000000..8219952299 --- /dev/null +++ b/test/files/run/t8575c.scala @@ -0,0 +1,23 @@ +class C + +trait TypeMember { + type X + type Y + type Z +} + +object Test extends TypeMember { + type A = X with Y + type B = Z with A + type F = A with B + + def main(args: Array[String]) { + import reflect.runtime.universe._ + val t1 = typeOf[F with C] + val t2 = typeOf[(A with B) with C] + val t3 = typeOf[A with B with C] + assert(t1 =:= t2) + assert(t2 =:= t3) + assert(t3 =:= t1) + } +} diff --git a/test/files/run/t8710.scala b/test/files/run/t8710.scala new file mode 100644 index 0000000000..15aab5b8a4 --- /dev/null +++ b/test/files/run/t8710.scala @@ -0,0 +1,17 @@ +class Bar(val x: Int) extends AnyVal { + def f: String = f(0) + private def f(x: Int): String = "" +} + +class Baz(val x: Int) extends AnyVal { + def f: String = "123" + private def f(x: Int): String = "" +} +object Baz { + def x(b: Baz) = b.f(0) +} + +object Test extends App { + new Bar(23).f + new Baz(23).f +} diff --git a/test/files/run/t8764.check b/test/files/run/t8764.check deleted file mode 100644 index 6260069602..0000000000 --- a/test/files/run/t8764.check +++ /dev/null @@ -1,5 +0,0 @@ -IntOnly: should return an unboxed int -Int: int -IntAndDouble: should just box and return Anyval -Double: class java.lang.Double -Int: class java.lang.Integer diff --git a/test/files/run/t8764.flags b/test/files/run/t8764.flags deleted file mode 100644 index 48fd867160..0000000000 --- a/test/files/run/t8764.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/test/files/run/t8764.scala b/test/files/run/t8764.scala deleted file mode 100644 index decc658f6e..0000000000 --- a/test/files/run/t8764.scala +++ /dev/null @@ -1,16 +0,0 @@ -object Test extends App { -case class IntOnly(i: Int, j: Int) - -println("IntOnly: should return an unboxed int") -val a = IntOnly(1, 2) -val i: Int = a.productElement(0) -println(s"Int: ${a.productElement(0).getClass}") - -case class IntAndDouble(i: Int, d: Double) - -println("IntAndDouble: should just box and return Anyval") -val b = IntAndDouble(1, 2.0) -val j: AnyVal = b.productElement(0) -println(s"Double: ${b.productElement(1).getClass}") -println(s"Int: ${b.productElement(0).getClass}") -} diff --git a/test/files/run/t8918-unary-ids.check b/test/files/run/t8918-unary-ids.check new file mode 100644 index 0000000000..92f02371c7 --- /dev/null +++ b/test/files/run/t8918-unary-ids.check @@ -0,0 +1,7 @@ +Expected 41 lines, got 39 +--- expected ++++ actual +@@ -1,3 +1,1 @@ +-Type in expressions to have them evaluated. +-Type :help for more information. + diff --git a/test/files/run/t8918-unary-ids.scala b/test/files/run/t8918-unary-ids.scala new file mode 100644 index 0000000000..3aa990f72c --- /dev/null +++ b/test/files/run/t8918-unary-ids.scala @@ -0,0 +1,49 @@ + + +import scala.tools.partest.SessionTest + +// Taking unary ids as plain +object Test extends SessionTest { + def session = +"""Type in expressions to have them evaluated. +Type :help for more information. + +scala> val - = 42 +-: Int = 42 + +scala> val i = - +i: Int = 42 + +scala> - { 42 } +res0: Int = -42 + +scala> - if (true) 1 else 2 +<console>:1: error: illegal start of simple expression +- if (true) 1 else 2 + ^ + +scala> - - 1 +<console>:1: error: ';' expected but integer literal found. +- - 1 + ^ + +scala> -.-(1) +res1: Int = 41 + +scala> - +res2: Int = 42 + +scala> - - +res3: Int = -42 + +scala> + - +res4: Int = 42 + +scala> object X { def -(i: Int) = 42 - i ; def f(g: Int => Int) = g(7) ; def j = f(-) } +defined object X + +scala> X.j +res5: Int = 35 + +scala> :quit""" +} diff --git a/test/files/run/t8944/A_1.scala b/test/files/run/t8944/A_1.scala new file mode 100644 index 0000000000..7ff80327b0 --- /dev/null +++ b/test/files/run/t8944/A_1.scala @@ -0,0 +1 @@ +case class A(private val x: String) diff --git a/test/files/run/t8944/A_2.scala b/test/files/run/t8944/A_2.scala new file mode 100644 index 0000000000..3dcdea1583 --- /dev/null +++ b/test/files/run/t8944/A_2.scala @@ -0,0 +1,6 @@ +case class Other(private val x: String) // consume a fresh name suffix + +// the param accessor will now be called "x$2", +// whereas the previously compiled client expects it to be called +// x$1 +case class A(private val x: String) diff --git a/test/files/run/t8944/Test_1.scala b/test/files/run/t8944/Test_1.scala new file mode 100644 index 0000000000..fe466693cf --- /dev/null +++ b/test/files/run/t8944/Test_1.scala @@ -0,0 +1,3 @@ +object Test extends App { + val A("") = new A("") +} diff --git a/test/files/run/t8944b.scala b/test/files/run/t8944b.scala new file mode 100644 index 0000000000..f469122ce6 --- /dev/null +++ b/test/files/run/t8944b.scala @@ -0,0 +1,9 @@ +case class A(private var foo: Any) { + def m = { def foo = 42 /*will be lamba lifted to `A#foo$1`*/ } +} +object Test { + def main(args: Array[String]): Unit = { + val A("") = new A("") + new A("").m + } +} diff --git a/test/files/run/t8944c.check b/test/files/run/t8944c.check new file mode 100644 index 0000000000..7738f76980 --- /dev/null +++ b/test/files/run/t8944c.check @@ -0,0 +1,5 @@ +private java.lang.Object Foo.ant() +public java.lang.Object Foo.ant$access$0() +private scala.collection.Seq Foo.cat() +public scala.collection.Seq Foo.cat$access$2() +public java.lang.Object Foo.elk() diff --git a/test/files/run/t8944c.scala b/test/files/run/t8944c.scala new file mode 100644 index 0000000000..95c2143851 --- /dev/null +++ b/test/files/run/t8944c.scala @@ -0,0 +1,8 @@ +case class Foo[A](private val ant: Any, elk: Any, private val cat: A*) + +object Test { + def main(args: Array[String]): Unit = { + def pred(name: String) = Set("ant", "elk", "cat").exists(name contains _) + println(classOf[Foo[_]].getDeclaredMethods.filter(m => pred(m.getName)).sortBy(_.getName).mkString("\n")) + } +} diff --git a/test/files/run/t8955.scala b/test/files/run/t8955.scala new file mode 100644 index 0000000000..afa31aa5d7 --- /dev/null +++ b/test/files/run/t8955.scala @@ -0,0 +1,12 @@ +import scala.collection.parallel.immutable.ParSet + +object Test { + def main(args: Array[String]): Unit = { + for (i <- 1 to 2000) test() + } + + def test() { + ParSet[Int]((1 to 10000): _*) foreach (x => ()) // hangs non deterministically + } +} + diff --git a/test/files/run/t8960.scala b/test/files/run/t8960.scala index a58ac53d33..a43d5679d8 100644 --- a/test/files/run/t8960.scala +++ b/test/files/run/t8960.scala @@ -1,5 +1,5 @@ object Test extends App { - def test(o: AnyRef, sp: Boolean = false) = { + def testAnonFunClass(o: AnyRef, sp: Boolean = false) = { val isSpecialized = o.getClass.getSuperclass.getName contains "$sp" val isDelambdafyMethod = o.getClass.getName contains "$lambda$" assert( @@ -11,62 +11,68 @@ object Test extends App { assert(f.getLong(null) == 0l) } - test(() => (), sp = true) - test(() => 1, sp = true) - test(() => "") + def testIndyLambda(o: AnyRef, sp: Boolean = false) = { + val isSpecialized = o.getClass.getInterfaces.exists(_.getName contains "$sp") + assert(sp == isSpecialized, o.getClass.getName) + } + + + testIndyLambda(() => (), sp = true) + testIndyLambda(() => 1, sp = true) + testIndyLambda(() => "") - test((x: Int) => x, sp = true) - test((x: Boolean) => x) - test((x: Int) => "") + testIndyLambda((x: Int) => x, sp = true) + testIndyLambda((x: Boolean) => x) + testIndyLambda((x: Int) => "") - test((x1: Int, x2: Int) => 0d, sp = true) - test((x1: Int, x2: AnyRef) => 0d) - test((x1: Any, x2: Any) => x1) + testIndyLambda((x1: Int, x2: Int) => 0d, sp = true) + testIndyLambda((x1: Int, x2: AnyRef) => 0d) + testIndyLambda((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")) + // scala> println((for (i <- 3 to 22) yield (for (j <- 1 to i) yield s"x$j: Int").mkString(" testIndyLambda((", ", ", ") => 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) + testIndyLambda((x1: Int, x2: Int, x3: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int) => x1) + testIndyLambda((x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int) => x1) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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) + testIndyLambda((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({ + testAnonFunClass({ case x: Int => x }: PartialFunction[Int, Int], sp = true) - test({ + testAnonFunClass({ case x: Int => x }: PartialFunction[Any, Any]) - test({ + testAnonFunClass({ case x: Int => () }: PartialFunction[Int, Unit], sp = true) - test({ + testAnonFunClass({ case x: String => 1 }: PartialFunction[String, Int]) - test({ + testAnonFunClass({ case x: String => () }: PartialFunction[String, Unit]) - test({ + testAnonFunClass({ 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) } } diff --git a/test/files/run/t9174.check b/test/files/run/t9174.check new file mode 100644 index 0000000000..14d6bc10db --- /dev/null +++ b/test/files/run/t9174.check @@ -0,0 +1,17 @@ + +scala> import scala.util.{Success, Failure} +import scala.util.{Success, Failure} + +scala> def f1(b: Boolean) = if (b) Left(1) else Right(2) +f1: (b: Boolean)scala.util.Either[Int,Int] + +scala> def f2(b: Boolean) = if (b) Nil else 1 :: Nil +f2: (b: Boolean)List[Int] + +scala> def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty) +f3: (b: Boolean)scala.collection.immutable.Stream[Int] + +scala> def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception("")) +f4: (b: Boolean)scala.util.Try[Int] + +scala> :quit diff --git a/test/files/run/t9174.scala b/test/files/run/t9174.scala new file mode 100644 index 0000000000..0c70e9bca9 --- /dev/null +++ b/test/files/run/t9174.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.util.{Success, Failure} + |def f1(b: Boolean) = if (b) Left(1) else Right(2) + |def f2(b: Boolean) = if (b) Nil else 1 :: Nil + |def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty) + |def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception("")) + |""".stripMargin +} diff --git a/test/files/run/t9200/Test.java b/test/files/run/t9200/Test.java new file mode 100644 index 0000000000..8ff0314f6c --- /dev/null +++ b/test/files/run/t9200/Test.java @@ -0,0 +1,6 @@ +public class Test { + public static void main(String[] args) { + new C1(new C2()); // Was NoSuchMethodError + } +} + diff --git a/test/files/run/t9200/test.scala b/test/files/run/t9200/test.scala new file mode 100644 index 0000000000..6fa7e91571 --- /dev/null +++ b/test/files/run/t9200/test.scala @@ -0,0 +1,12 @@ +trait W + +trait T1 +trait T2 extends T1 + +object O1 { + type t = T1 with T2 +} + +class C1[w<:W](o: O1.t) + +class C2 extends T1 with T2 diff --git a/test/files/run/test-cpp.check b/test/files/run/test-cpp.check index 13f4c64be3..40c10e3350 100644 --- a/test/files/run/test-cpp.check +++ b/test/files/run/test-cpp.check @@ -1,11 +1,11 @@ --- a +++ b -@@ -36,3 +36,3 @@ +@@ -54,3 +54,3 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, value x, value y + locals: value args startBlock: 1 -@@ -41,10 +41,6 @@ +@@ -59,10 +59,6 @@ 1: - 52 CONSTANT(2) - 52 STORE_LOCAL(value x) @@ -17,12 +17,12 @@ - 54 LOAD_LOCAL(value y) + 54 CONSTANT(2) 54 BOX INT -@@ -91,3 +87,3 @@ +@@ -109,3 +105,3 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, value x, value y + locals: value args, value x startBlock: 1 -@@ -100,7 +96,5 @@ +@@ -118,7 +114,5 @@ 81 SCOPE_ENTER value x - 82 LOAD_LOCAL(value x) - 82 STORE_LOCAL(value y) @@ -31,12 +31,12 @@ - 83 LOAD_LOCAL(value y) + 83 LOAD_LOCAL(value x) 83 BOX INT -@@ -134,3 +128,3 @@ +@@ -152,3 +146,3 @@ def main(args: Array[String] (ARRAY[REF(class String)])): Unit { - locals: value args, value x, value y + locals: value args startBlock: 1 -@@ -139,10 +133,6 @@ +@@ -157,10 +151,6 @@ 1: - 66 THIS(TestAliasChainDerefThis) - 66 STORE_LOCAL(value x) @@ -48,12 +48,12 @@ - 68 LOAD_LOCAL(value y) + 68 THIS(Object) 68 CALL_METHOD scala.Predef.println (dynamic) -@@ -175,3 +165,3 @@ +@@ -193,3 +183,3 @@ def test(x: Int (INT)): Unit { - locals: value x, value y + locals: value x startBlock: 1 -@@ -180,7 +170,5 @@ +@@ -198,7 +188,5 @@ 1: - 29 LOAD_LOCAL(value x) - 29 STORE_LOCAL(value y) @@ -62,7 +62,7 @@ - 30 LOAD_LOCAL(value y) + 30 LOAD_LOCAL(value x) 30 BOX INT -@@ -222,7 +210,5 @@ +@@ -240,7 +228,5 @@ 96 SCOPE_ENTER variable x - 97 LOAD_LOCAL(variable x) - 97 STORE_LOCAL(variable y) @@ -71,7 +71,7 @@ - 98 LOAD_LOCAL(variable y) + 98 LOAD_LOCAL(variable x) 98 BOX INT -@@ -232,6 +218,4 @@ +@@ -250,6 +236,4 @@ 100 STORE_LOCAL(variable y) - 101 LOAD_LOCAL(variable y) - 101 STORE_LOCAL(variable x) diff --git a/test/files/run/test-cpp.scala b/test/files/run/test-cpp.scala index 4e00e72658..7db831fb09 100644 --- a/test/files/run/test-cpp.scala +++ b/test/files/run/test-cpp.scala @@ -15,7 +15,7 @@ import scala.tools.partest.IcodeComparison object Test extends IcodeComparison { - override def printIcodeAfterPhase = "dce" + override def printIcodeAfterPhase = "dce"; override def extraSettings: String = super.extraSettings + " -Ybackend:GenASM" // same line to minimize check file changs } import scala.util.Random._ |