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

NumericRange[Long] doesn't support ranges with more than Int.MaxValue values

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: None
    • Component/s: Misc Library
    • Labels:
      None

      Description

      The title pretty much says it all. As soon as any caller invokes count() - at some indefinite time after construction - a NumericRange[Long] with a long range throws an IllegalArgumentException.

      count() is used very ubiquitously in the implementation of the class - even in toString() - so it's not really avoidable.

      I know the current behavior is by design... but would it break a lot of things if count()/length() returned a Long?

      FWIW, this was driven by StackOverflow post http://stackoverflow.com/questions/9888706 .

        Issue Links

          Activity

          Hide
          Daniel Sobral added a comment -

          It would break things, it would preclude array-based implementations, and it would impose a performance penalty on anything that used indices.

          Show
          Daniel Sobral added a comment - It would break things, it would preclude array-based implementations, and it would impose a performance penalty on anything that used indices.

            People

            • Assignee:
              Unassigned
              Reporter:
              Ed Staub
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development