You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A NumericRange with more than Int.MaxValue elements can be created, but is almost useless since we cannot use it:
=== Reproduce bug ===
scala> object Test {val x = 1L to 1000000000000L}
defined module Test
scala> Test.x take 10
=== Propositions ===
Reject such NumericRange at their initialization.
PRO It seems that it suffices to remove the lazy evaluation of numRangeElements to do it.
CON We need to evaluate it at initialization, it's a (small?) performance penalty
Try to workaround the issue: many methods can be updated to avoid call to length.
CON painful patch, implementation will not be harmonized with Range
CON some methods cannot be rewritten (length ofr example)
PRO We can use "long" NumericRange for some operations
Don't do anything: keep it as a feature
The text was updated successfully, but these errors were encountered:
@axel22 said:
This range is rejected at its initialization point. It's just that the object Test is initialized lazily - the first time it's accessed.
Try this:
scala>objectTest { println("hello :-)") }
defined module Test
scala>Test
hello :-)
res0:Test.type=Test$@6eb92a0e
A NumericRange with more than Int.MaxValue elements can be created, but is almost useless since we cannot use it:
=== Reproduce bug ===
scala> object Test {val x = 1L to 1000000000000L}
defined module Test
scala> Test.x take 10
=== Propositions ===
PRO It seems that it suffices to remove the lazy evaluation of numRangeElements to do it.
CON We need to evaluate it at initialization, it's a (small?) performance penalty
CON painful patch, implementation will not be harmonized with Range
CON some methods cannot be rewritten (length ofr example)
PRO We can use "long" NumericRange for some operations
The text was updated successfully, but these errors were encountered: