Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splats with non-array like values #3007

Closed
ahawkins opened this Issue May 31, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@ahawkins
Copy link

ahawkins commented May 31, 2015

I came across this code trying out some of my thrift related things on jruby 9000. Here's the relevant source: https://github.com/apache/thrift/blob/master/lib/rb/lib/thrift/types.rb#L46-68

Now for the offending source.

klasses = String
[*klasses]

On MRI 2.2: [String]

On JRuby 9000:

irb(main):005:0> klasses = String
=> String
irb(main):006:0> [*klasses]
NoMethodError: undefined method `to_a' for String:Class
        from org/jruby/RubyBasicObject.java:1606:in `method_missing'
        from (irb):6:in `<eval>'
        from org/jruby/RubyKernel.java:1005:in `eval'
        from org/jruby/RubyKernel.java:1315:in `loop'
        from org/jruby/RubyKernel.java:1125:in `catch'
        from org/jruby/RubyKernel.java:1125:in `catch'
        from /Users/ahawkins/.rbenv/versions/jruby-9.0.0.0.pre2/bin/irb:13:in `<top>'

I have no idea what the intended behavior is, if this is a weird MRI thing or a missing method in jRuby.

@kares kares added the JRuby 9000 label Jun 1, 2015

@kares kares added this to the JRuby 9.0.0.0.rc1 milestone Jun 1, 2015

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Jun 2, 2015

Yeah this is wacky. most classes core or user-defined fail here.

@enebo enebo closed this in 62f4721 Jun 2, 2015

@ahawkins

This comment has been minimized.

Copy link
Author

ahawkins commented Jun 2, 2015

@enebo awesome work, will verify again when RC1 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.