java.lang.IllegalArgumentException: transpose requires all collections have the same size

1,781 views
Skip to first unread message

opyate

unread,
Sep 20, 2011, 6:25:56 PM9/20/11
to simple-build-tool
Hello,

I was wondering if someone could shed some light on a compilation
error I'm getting for which a Google search yields 2 unrelated
results:
1) https://issues.scala-lang.org/browse/SI-4786
2) a link to the lampsvn.epfl.ch source file where the exception text
can be found

The code to try can be found here:

https://github.com/opyate/scala-graph

To clone it, and the submodules:

git clone g...@github.com:opyate/scala-graph.git
cd scala-graph
git submodule init
git submodule update

For the usual target (2.9.1), the exception is:

java.lang.IllegalArgumentException: transpose requires all collections
have the same size

Also, trying it for 2.9.0-1:

java.lang.AssertionError: assertion failed

I've also tried building core's JAR first, putting the jar in
constrained/lib and then building constrained, and I get the same
error.

Thanks,
Juan

PS My co-developer reckons he can compile the whole lot in Eclipse.
I've asked for the project files to see if I'm missing something. In
that vein, could someone please point me to a good resource that
explains how the Eclipse incremental compiler works, how it differs
from how SBT uses the Scala compiler, etc. Running "last compile"
after getting the 2.9.1 error, in the stack trace I see
sbt.inc.IncrementalCompile and sbt.AggressiveCompile. How do these
work and how do they differ from the way Eclipse does things, for
instance?

Jason Zaugg

unread,
Sep 21, 2011, 4:07:01 AM9/21/11
to simple-b...@googlegroups.com
Please post the stack trace and the version of SBT that you're using.

Does it work after a 'clean'?

-jason

opyate

unread,
Sep 21, 2011, 6:02:07 AM9/21/11
to simple-build-tool
Thanks Jason.

I'm using SBT 0.10.1 and have also tried SBT 0.10.0, and I've tried
cleaning (and force-removing target directories).

Here's the pastie link, and the stack trace too:

http://pastie.org/2567578

<trace>
java.lang.IllegalArgumentException: transpose requires all collections
have the same size
at scala.collection.generic.GenericTraversableTemplate$class.fail
$1(GenericTraversableTemplate.scala:150)
at scala.collection.generic.GenericTraversableTemplate$$anonfun
$transpose$1$$anonfun$apply$1.apply(GenericTraversableTemplate.scala:
157)
at scala.collection.generic.GenericTraversableTemplate$$anonfun
$transpose$1$$anonfun$apply$1.apply(GenericTraversableTemplate.scala:
156)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.GenericTraversableTemplate$$anonfun
$transpose$1.apply(GenericTraversableTemplate.scala:156)
at scala.collection.generic.GenericTraversableTemplate$$anonfun
$transpose$1.apply(GenericTraversableTemplate.scala:154)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.GenericTraversableTemplate
$class.transpose(GenericTraversableTemplate.scala:154)
at scala.collection.immutable.List.transpose(List.scala:45)
at scala.tools.nsc.symtab.Types$class.mergePrefixAndArgs(Types.scala:
5572)
at
scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:
13)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lub1$1(Types.scala:5309)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5302)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5387)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5581)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5572)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:65)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:63)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.Tuple2$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.symtab.Types$class.mergePrefixAndArgs(Types.scala:
5572)
at
scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:
13)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lub1$1(Types.scala:5309)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5302)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5291)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5387)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$class.lubsym$1(Types.scala:5329)
at scala.tools.nsc.symtab.Types$$anonfun$39.apply(Types.scala:5352)
at scala.tools.nsc.symtab.Types$$anonfun$39.apply(Types.scala:5347)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.symtab.Types$class.lub1$1(Types.scala:5347)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5302)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5387)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5578)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5572)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:65)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:63)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.Tuple2$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.symtab.Types$class.mergePrefixAndArgs(Types.scala:
5572)
at
scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:
13)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lub1$1(Types.scala:5309)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5302)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5387)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5578)
at scala.tools.nsc.symtab.Types$$anonfun$54.apply(Types.scala:5572)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:65)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:63)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.Tuple2$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.symtab.Types$class.mergePrefixAndArgs(Types.scala:
5572)
at
scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs(SymbolTable.scala:
13)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:5122)
at scala.tools.nsc.symtab.Types$class.lub1$1(Types.scala:5309)
at scala.tools.nsc.symtab.Types$class.lub0$1(Types.scala:5302)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5387)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$class.lub(Types.scala:5275)
at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
at scala.tools.nsc.backend.icode.TypeKinds$$anonfun
$lub0$1$1.apply(TypeKinds.scala:151)
at scala.tools.nsc.backend.icode.TypeKinds$$anonfun
$lub0$1$1.apply(TypeKinds.scala:149)
at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:95)
at scala.tools.nsc.backend.icode.TypeKinds$class.scala$tools$nsc
$backend$icode$TypeKinds$class$$lub0$1(TypeKinds.scala:149)
at scala.tools.nsc.backend.icode.TypeKinds$class.lub(TypeKinds.scala:
175)
at scala.tools.nsc.backend.icode.ICodes.lub(ICodes.scala:25)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeStackLattice$$anonfun$lub2$1.apply(TypeFlowAnalysis.scala:53)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeStackLattice$$anonfun$lub2$1.apply(TypeFlowAnalysis.scala:53)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:65)
at scala.Tuple2$Zipped$$anonfun$map$1.apply(Tuple2.scala:63)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.Tuple2$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeStackLattice$.lub2(TypeFlowAnalysis.scala:53)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeFlowLattice$.lub2(TypeFlowAnalysis.scala:91)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeFlowLattice$.lub2(TypeFlowAnalysis.scala:71)
at scala.tools.nsc.backend.icode.analysis.SemiLattice$$anonfun$lub
$1.apply(SemiLattice.scala:43)
at scala.collection.LinearSeqOptimized
$class.foldLeft(LinearSeqOptimized.scala:111)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.LinearSeqOptimized
$class.reduceLeft(LinearSeqOptimized.scala:125)
at scala.collection.immutable.List.reduceLeft(List.scala:45)
at scala.tools.nsc.backend.icode.analysis.SemiLattice
$class.lub(SemiLattice.scala:43)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$typeFlowLattice$.lub(TypeFlowAnalysis.scala:71)
at scala.tools.nsc.backend.icode.analysis.DataFlowAnalysis$$anonfun
$forwardAnalysis$1.apply(DataFlowAnalysis.scala:75)
at scala.tools.nsc.backend.icode.analysis.DataFlowAnalysis$$anonfun
$forwardAnalysis$1.apply(DataFlowAnalysis.scala:68)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.icode.analysis.DataFlowAnalysis
$class.forwardAnalysis(DataFlowAnalysis.scala:68)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$MethodTFA.forwardAnalysis(TypeFlowAnalysis.scala:99)
at scala.tools.nsc.backend.icode.analysis.TypeFlowAnalysis
$MethodTFA.run(TypeFlowAnalysis.scala:165)
at scala.tools.nsc.backend.opt.Inliners
$Inliner.analyzeMethod(Inliners.scala:208)
at scala.tools.nsc.backend.opt.Inliners$Inliner$$anonfun$analyzeClass
$3.apply(Inliners.scala:105)
at scala.tools.nsc.backend.opt.Inliners$Inliner$$anonfun$analyzeClass
$3.apply(Inliners.scala:105)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.backend.opt.Inliners
$Inliner.analyzeClass(Inliners.scala:105)
at scala.tools.nsc.backend.opt.Inliners
$InliningPhase.apply(Inliners.scala:62)
at scala.tools.nsc.backend.icode.ICodes$ICodePhase$$anonfun$apply
$2.apply(ICodes.scala:117)
at scala.tools.nsc.backend.icode.ICodes$ICodePhase$$anonfun$apply
$2.apply(ICodes.scala:117)
at scala.collection.LinearSeqOptimized
$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder
$class.foreach(TraversableForwarder.scala:30)
at scala.collection.mutable.LinkedHashSet.foreach(LinkedHashSet.scala:
76)
at scala.tools.nsc.backend.icode.ICodes$ICodePhase.apply(ICodes.scala:
117)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:329)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run
$1.apply(Global.scala:297)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run
$1.apply(Global.scala:297)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.mutable.ListBuffer$$anon
$1.foreach(ListBuffer.scala:316)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:297)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:953)
at scala.tools.nsc.Global$Run.compile(Global.scala:1038)
at xsbt.CompilerInterface.run(CompilerInterface.scala:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:57)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:25)
at sbt.AggressiveCompile$$anonfun$6.compileScala
$1(AggressiveCompile.scala:67)
at sbt.AggressiveCompile$$anonfun$6.apply(AggressiveCompile.scala:79)
at sbt.AggressiveCompile$$anonfun$6.apply(AggressiveCompile.scala:57)
at sbt.inc.IncrementalCompile$$anonfun$doCompile
$1.apply(Compile.scala:21)
at sbt.inc.IncrementalCompile$$anonfun$doCompile
$1.apply(Compile.scala:19)
at sbt.inc.Incremental$.cycle(Incremental.scala:33)
at sbt.inc.Incremental$.compile(Incremental.scala:20)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:17)
at sbt.AggressiveCompile.compile2(AggressiveCompile.scala:87)
at sbt.AggressiveCompile.compile1(AggressiveCompile.scala:38)
at sbt.AggressiveCompile.apply(AggressiveCompile.scala:28)
at sbt.Compiler$.apply(Compiler.scala:107)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:420)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:420)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:506)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:506)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:44)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply
$9.apply(Structure.scala:304)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply
$9.apply(Structure.scala:304)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$5.work(System.scala:67)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:
221)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:
221)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13)
at sbt.Execute.work(Execute.scala:227)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:
26)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
[error] {file:/Users/juanuys/Documents/src/github/scala-graph-project/}
scala-graph-constrained/compile: java.lang.IllegalArgumentException:
transpose requires all collections have the same size
</trace>

Thanks,
Juan

Mark Harrah

unread,
Sep 23, 2011, 9:44:51 PM9/23/11
to simple-b...@googlegroups.com
Hi Juan,

Is -optimise enabled in Eclipse? If I remove -optimise, the project compiles.

How the incremental compilers work and how they differ are questions that would take some time to answer. There aren't any existing explanations that I know of.

-Mark

opyate

unread,
Sep 26, 2011, 12:10:50 PM9/26/11
to simple-build-tool
On Sep 24, 2:44 am, Mark Harrah <dmhar...@gmail.com> wrote:
> Is -optimise enabled in Eclipse?  If I remove -optimise, the project compiles.
>
> How the incremental compilers work and how they differ are questions that would take some time to answer.  There aren't any existing explanations that I know of.
>
> -Mark

Thanks for having a look, Mark.
I removed "-optimise" and "-Yinline" and it works.
Reply all
Reply to author
Forward
0 new messages