When to_ary from yield does not return an array we ClassCast
------------------------------------------------------------

                 Key: JRUBY-5950
                 URL: https://jira.codehaus.org/browse/JRUBY-5950
             Project: JRuby
          Issue Type: Bug
          Components: Interpreter
    Affects Versions: JRuby 1.6.3
            Reporter: Thomas E Enebo


{noformat} 
jruby -e 'class Foo; def to_ary; Foo.new; end; end; def foo(a); yield a; end; 
foo(Foo.new) { |a, b| p a, b }' ArgsUtil.java:86:in 
`convertToRubyArrayWithCoerce': java.lang.ClassCastException: 
org.jruby.RubyObject cannot be cast to org.jruby.RubyArray from ArgsUtil.java:69
{noformat} 

This should give an error like: 
{noformat} 
ruby -e 'class Foo; def to_ary; Foo.new; end; end; def foo(a); yield a; end; 
foo(Foo.new) { |a, b| p a, b }'
-e:1: Foo#to_ary should return Array (TypeError) 
{noformat}



--
This message is automatically generated by JIRA.
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