MatchData#begin raises NativeException (ClassCastException) when passed a Range
-------------------------------------------------------------------------------
Key: JRUBY-1112
URL: http://jira.codehaus.org/browse/JRUBY-1112
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.0RC3
Environment: OS X 10.4.9, Java 1.5,
Reporter: Daniel Berger
Priority: Minor
This code should merely raise a TypeError. JRuby raises a NativeException.
{noformat}
irb(main):002:0> /(.)(.)(\d+)(\d)/.match('THX1138').begin(1..2)
NativeException: java.lang.ClassCastException: org.jruby.RubyRange
from null:-1:in `org.jruby.RubyMatchDataInvokerbegin1.call'
from FastInvocationCallback.java:49:in
`org.jruby.runtime.callback.FastInvocationCallback.execute'
...
{noformat}
The same thing happens for MatchData#end and MatchData#offset.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email