-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
String range object incorrectly tries to convert to int #4021
Comments
I just noticed that the same problem occurs on jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 24.79-b02 on 1.7.0_79-b15 +jit [Windows 7-amd64] as well. |
present in latest 9K (9.1.2.0) as well ... maybe the index is too big when |
On Tue, Jul 19, 2016, at 13:33, Karol Bucek wrote:
I don't think so, for two reason: First, the array would contain only 1 I didn't look at the Ruby code, but from the behaviour, a wild guess Ranges of strings are defined (according to the docs) in terms of the Ronald |
On Tue, Jul 19, 2016, at 17:53, Karol Bucek wrote: Thank you for fixing this so quickly. Just a personal question: Why is
causes a conversion to int, while the seemingly similar
works fine. Why is it that not all strings are treated equal in a Range? Ronald |
jruby 1.7.25 (1.9.3p551) 2016-04-13 867cb81 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_79-b15 +jit [Windows 7-amd64]
Consider the following programs:
Or alternatively:
These are string ranges, and it works in MRI Ruby (the first example should return true, and the second one should returne a one-element array). In JRuby, I get an error:
It seems that JRuby tries to convert the range bounds into Java int values!
The text was updated successfully, but these errors were encountered: