Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 867179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:55:56+00:00 2026-05-15T09:55:56+00:00

I have a pair of loops over a nested array object in scala def

  • 0

I have a pair of loops over a nested array object in scala

def populateBoard(data:Array[Array[Char]]) {

    Board.resize(data(0).length, data.length)

    for(y <- 0 to data.length-1) {
        val row = data(y)
        for(x <- 0 to row.length-1) {
            Board.putObjectAt(x,y,GamePieceFactory.createInstance(row(x),x,y))
        }
    }

}

Which works just fine in the unit tests, but when 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 37 is the line for(y <- 0 to data.length-1). Very odd. The unit tests run scala 2.6.1 and the command line is 2.7.7. Are there some backward incompatible changes between these two versions?

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:55:56+00:00Added an answer on May 15, 2026 at 9:55 am

    Scala is not typically binary compatible between versions. In particular, 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 libraries almost certainly have and thus you may run into errors. I would suspect that you’re not running with the same version you’re compiling with.

    Also, you may wish to use 0 until n rather than 0 to n - 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 javascript loops, one nested in the other, that does an AJAX
I have a pair of computers running arch linux with rabbitmq message queues and
I have a pair of static fields with a complicated one-time initialization. I want
If I have a pair of dates, and I want to generate a list
Is this even possible? I have a key-pair that I already made with GPG
I have a program which outputs a pair of words surrounded by spaces on
I have a public/private key pair set up so I can ssh to a
I have vector< pair<int, int>> myVec (N); I want to have all pairs initialized
i have a strange issue with phpexcel on a pair of formulas and can't
I have a situation where I want to map a pair of objects to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.