Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this issue Mar 27, 2012 · 2 comments
Closed

Comments

@scabug
Copy link

scabug commented Mar 27, 2012

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 .

@scabug
Copy link
Author

scabug commented Mar 27, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5619?orig=1
Reporter: Ed Staub (estaub)
Affected Versions: 2.9.1
See #5622

@scabug
Copy link
Author

scabug commented Mar 27, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant