Scala Programming Language
  1. Scala Programming Language
  2. SI-4748

Unexpected return value for Range(x,y).init

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.0
    • Fix Version/s: None
    • Component/s: Misc Library
    • Labels:
      None
    • Environment:

      Windows 7 x32 (Oracle JRockit(R), Java 1.6.0_24)

      Description

      I would expect

      >Range(1,30).init
      scala.collection.immutable.Range = Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)

      Instead I get
      scala.collection.immutable.Range = Range(1)

      This works:
      Range(1,30).toList.init
      List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1
      8, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r25209) Fix for unfortunate bug in Range.init. Closes #4748, no review.

        Show
        Commit Message Bot added a comment - (extempore in r25209 ) Fix for unfortunate bug in Range.init. Closes #4748, no review.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Montez Fitzpatrick
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development