Skip to content

Instantly share code, notes, and snippets.

@adamruzicka
Created March 19, 2024 09:19
Show Gist options
  • Save adamruzicka/0cf0c8d1afeb67f9e8a0b497221f8170 to your computer and use it in GitHub Desktop.
Save adamruzicka/0cf0c8d1afeb67f9e8a0b497221f8170 to your computer and use it in GitHub Desktop.
def bar(a, b, c)
puts [a, b, c]
end
def foo(...)
bar(1, ...)
end
foo(1, 2)
@adamruzicka
Copy link
Author

# ruby --version                                                                                                                                                                                                                                                                 
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [aarch64-linux]

# ruby test.rb                                                                                                                                                                                                                                                                   
1
1
2
#  ruby --version                                                                                                                                                                                                                                                            
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [aarch64-linux]

# ruby test.rb
test.rb:6: syntax error, unexpected ')'
  bar(1, ...)
test.rb:9: syntax error, unexpected end-of-input, expecting `end'

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