NoMethod error from scala loop -


I have a pair of loops on the nested array and object in the scales

  def populateBoard (Data: Array [Array [four]] {Board. Size (Data (0). (Y & lt; -0 to data.length-1) {val line = data (length) for X (l) - 0 to row.length-1) {Board.putObjectAt (x, y, GamePieceFactory.createInstance (line (x), x, y))}}  

Which unit works fine in testing, but when I If I run the application, I get the following exception:

  java.lang.NoSuchMethodError: scala.runtime.RichInt.to (I) Lscala / Range; At net.ceilingfish.pacman.App $ .PopulateBoard (App.scala: 37)  

line is for line 37 (y & lt; - 0 to data.length- 1) . Very weird The unit test runs Scala 2.6.1 and the command line is 2.7.7. Are there some backward inconsistent changes between these two versions?

UPDATE I switched unit tests to version 2.7.7 and they run on fine working. Even odder.

Scala is usually not binary compatible between versions. Specifically, this means that if you compile for 2.6.1 and then try to run for 2.7.7, even if the syntax has not changed at all, the library is almost certainly and This way you can run in errors. I suspect that you are not running with the same version, which you are compiling.

In addition, you 0 to N - 1 instead of 0 by n .


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -