Skip to content

String range object incorrectly tries to convert to int #4021

@rovf

Description

@rovf

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:

mystr='2202702806'; (mystr..mystr).member?(mystr)

Or alternatively:

("2202702806".."2202702806").to_a

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:

RangeError: integer 2202702806 too big to convert to `int'

It seems that JRuby tries to convert the range bounds into Java int values!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions