mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
8589e8c236
For now argument forwarding doesn't allow some keywords like `true` as a method name. To bypass the issue, fallback to `define_method` if method names are Ruby reserved keywords. https://bugs.ruby-lang.org/issues/16854 ```ruby class Works def true(*args) puts(*args) end end Works.new.true 1, 2, 3 # => 1, 2, 3 class WontWork def true(...) puts(...) end end ``` ``` % ruby a.rb a.rb:12: syntax error, unexpected ..., expecting ')' def true(...) a.rb:13: unexpected ... a.rb:15: syntax error, unexpected `end', expecting end-of-input ``` |
||
---|---|---|
.. | ||
default_scoping_test.rb | ||
named_scoping_test.rb | ||
relation_scoping_test.rb |