Float#coerce fails when invoked with String argument
----------------------------------------------------

                 Key: JRUBY-1589
                 URL: http://jira.codehaus.org/browse/JRUBY-1589
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Ubuntu Linux 7.10,
ruby 1.8.5 (2007-11-20 rev 4842) [i386-jruby1.1b1]
            Reporter: Vladimir Sizikov


This works: jruby -e 'p 1.coerce("2.5")'   ===> [2.5, 1.0]

This doesn't: jruby -e 'p 1.8.coerce("2.5")' ===> wrong argument type String 
(expected Numeric) (TypeError)

The only difference is Fixnum vs Float. So, the Float's version of coerce() 
doesn't work with String arguments.

This leads to Rubinius spec test failure:

Float#coerce returns [other, self] both as Floats FAILED
wrong argument type String (expected Numeric):
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:4
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:4:in `it'
/opt/work/rubinius/spec/mini_rspec.rb:355:in `it'
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:4:in `it'
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:4:in `describe'
/opt/work/rubinius/spec/mini_rspec.rb:399:in `describe'
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:3:in `describe'
/opt/work/rubinius/./spec/core/float/coerce_spec.rb:3:in `load'
last_mspec.rb:11:in `load'
last_mspec.rb:1:in `each'
last_mspec.rb:6:in `each'


-- 
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

Reply via email to