Sorry to be such a bother with this M4 build, but I unfortunately hit another snag on the plane. Rickard deployed an M4 build of ScalaCheck which ScalaTest is choking on. You don't need ScalaTest to reproduce it, just ScalaCheck. Here's an interpreter session with M3:
Mi-Novia:scalacheckprob bv$ /usr/artima/scala-2.10.0-M3/bin/scala -cp scalacheck_2.10.0-M3-1.10-SNAPSHOT.jar
Welcome to Scala version 2.10.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import org.scalacheck.Prop
import org.scalacheck.Prop
scala> import org.scalacheck.Arg
import org.scalacheck.Arg
scala> def getArgsWithSpecifiedNames(argNames: Option[List[String]], scalaCheckArgs: Prop.Args): List[Arg[Any]] = {
| if (argNames.isDefined) {
| // length of scalaCheckArgs should equal length of argNames
| val zipped = argNames.get zip scalaCheckArgs
| zipped map { case (argName, arg) => arg.copy(label = argName) }
| }
| else
| scalaCheckArgs
| }
getArgsWithSpecifiedNames: (argNames: Option[List[String]], scalaCheckArgs: org.scalacheck.Prop.Args)List[org.scalacheck.Arg[Any]]
And here's the same interpreter session with M4:
$ /usr/artima/scala-2.10.0-M4/bin/scala -cp scalacheck_2.10.0-M4-1.8.jar
Welcome to Scala version 2.10.0-M4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import org.scalacheck.Prop
import org.scalacheck.Prop
scala> import org.scalacheck.Arg
import org.scalacheck.Arg
scala> def getArgsWithSpecifiedNames(argNames: Option[List[String]], scalaCheckArgs: Prop.Args): List[Arg[Any]] = {
| if (argNames.isDefined) {
| // length of scalaCheckArgs should equal length of argNames
| val zipped = argNames.get zip scalaCheckArgs
| zipped map { case (argName, arg) => arg.copy(label = argName) }
| }
| else
| scalaCheckArgs
| }
<console>:13: error: type mismatch;
found : List[(Any => org.scalacheck.Pretty) => org.scalacheck.Arg[Any]]
required: List[org.scalacheck.Arg[Any]]
zipped map { case (argName, arg) => arg.copy(label = argName) }
^
A quite different result. Just for the heck of it I also tried Scala 2.10.0-M4 with the ScalaCheck build against 2.10.0-M3, got the same weirdness:
$ /usr/artima/scala-2.10.0-M4/bin/scala -cp scalacheck_2.10.0-M3-1.10-SNAPSHOT.jar
Welcome to Scala version 2.10.0-M4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import org.scalacheck.Prop
import org.scalacheck.Prop
scala> import org.scalacheck.Args
<console>:8: error: object Args is not a member of package org.scalacheck
import org.scalacheck.Args
^
scala> import org.scalacheck.Arg
import org.scalacheck.Arg
scala> def getArgsWithSpecifiedNames(argNames: Option[List[String]], scalaCheckArgs: Prop.Args): List[Arg[Any]] = {
| if (argNames.isDefined) {
| // length of scalaCheckArgs should equal length of argNames
| val zipped = argNames.get zip scalaCheckArgs
| zipped map { case (argName, arg) => arg.copy(label = argName) }
| }
| else
| scalaCheckArgs
| }
<console>:13: error: type mismatch;
found : List[(Any => org.scalacheck.Pretty) => org.scalacheck.Arg[Any]]
required: List[org.scalacheck.Arg[Any]]
zipped map { case (argName, arg) => arg.copy(label = argName) }
^
So it looks like a feature of M4. Any clues?
To make it easier to try out, here's code you can just paste into the interpreter to reproduce:
import org.scalacheck.Prop
import org.scalacheck.Arg
def getArgsWithSpecifiedNames(argNames: Option[List[String]], scalaCheckArgs: Prop.Args): List[Arg[Any]] = {
if (argNames.isDefined) {
// length of scalaCheckArgs should equal length of argNames
val zipped = argNames.get zip scalaCheckArgs
zipped map { case (argName, arg) => arg.copy(label = argName) }
}
else
scalaCheckArgs
}
Thanks.
Bill
On Sunday, June 17, 2012 6:35:15 AM UTC-7, Bill Venners wrote:
Hi Jason and Paul,
Thanks for chasing it down. I've got a flight today. Will deploy a new build after I get in.
Bill
On Sunday, June 17, 2012 1:04:00 AM UTC-7, Jason Zaugg wrote:
On Sun, Jun 17, 2012 at 3:44 AM, Bill Venners <bill-7L19218AtADQT0dZR+AlfA@public.gmane.org> wrote:
> I still get the blow up problem when I try to run the tests:
> [scalatest] java.lang.VerifyError: (class:
> org/scalatest/BeforeAndAfterEachFunctions$class, method: runTest signature:
> (Lorg/scalatest/BeforeAndAfterEachFunctions;Ljava/lang/String;Lorg/scalatest/Reporter;Lorg/scalatest/Stopper;Lscala/collection/immutable/Map;Lorg/scalatest/Tracker;)V)
> Register 16 contains wrong type
Here's a patch to workaround the problem.
https://gist.github.com/2943865
-jason