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 + Doubled Splats -> Nothing (1.7.19) #2799

Closed
fny opened this issue Apr 3, 2015 · 2 comments
Closed

Splats + Doubled Splats -> Nothing (1.7.19) #2799

fny opened this issue Apr 3, 2015 · 2 comments

Comments

@fny
Copy link

fny commented Apr 3, 2015

Using splats with double splats in a method leads to some pretty wonky behavior when running 1.7.19 in 2.0 mode. (Works in 9000.)

def example_a(*args, **keywords, &block)
  puts args.inspect
  puts keywords.inspect
  puts block.call.inspect
end
example_a(1, two: 2) { 3 }

Expected:

[1]
{:two=>2}
3

1.7.19:

[]
{}
3
def example_b(arg, *args, **keywords, &block)
  puts arg.inspect
  puts args.inspect
  puts keywords.inspect
  puts block.call.inspect
end
example_b(1, 2, three: 3) { 4 }

Expected:

1
[2]
{:three=>3}
4

1.7.19:

1
[]
{}
4
@headius
Copy link
Member

headius commented Apr 3, 2015

We're pretty unlikely to do much more work on 2.0 language features in the 1.7.x line, so your best bet may be trying to use 9000. JRuby 1.7's 2.0 mode was only ever considered experimental, and the language features were last updated sometime early in Ruby 2.0's lifecycle.

@enebo might have something else to say here, but I doubt we'll be putting much time into 1.7's 2.0 mode with 9000 nearly finished.

@enebo
Copy link
Member

enebo commented Apr 3, 2015

Yeah I sort of wish we would stop the idea of experimental modes/features in the future. The early access gives us feedback but it leads to endless reports and us having to apologize for putting out something partially baked.

We have fixed simple bugs with --2.0 in 1.7.x but kwargs in 1.7.x is not that simple and completely different than our support for kwargs in 9k. I recommend using our pre releases of 9k for any Ruby 2.x support. pre2 will be out very soon and we think it will lead to rc quickly after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants