String#slice! can't handle Float and non-standard numerics as arguments
-----------------------------------------------------------------------
Key: JRUBY-1745
URL: http://jira.codehaus.org/browse/JRUBY-1745
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Latest JRuby 1.1b1 from trunk
Reporter: Vladimir Sizikov
Attachments: string-slice-float.patch
Consider the following:
{noformat}
# testcase 1
puts "hello".slice!(0.5, 2.5)
# testcase 2
obj = Object.new
def obj.to_int() 2 end
puts "hello".slice!(obj, obj)
{noformat}
MRI, Rubinius return:
he
ll
JRuby returns:
1) first testcase ==> can't convert Float into String (TypeError)
2) second testcase ==> can't convert #<Class:01x17a4989> into String
(TypeError)
This also leads to one rubinius spec failure for string.
The proposed patch fixes the problem, and the spec failure.
--
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