Backport #7942
closed
keyword arguments must use with paren?
Added by jjyr (Jinyang Jiang) over 11 years ago.
Updated over 11 years ago.
Description
def hello name: "ruby2"
puts "hello #{name}"
end
syntax error, unexpected ':', expecting ';' or '\n'
def hello(name: "ruby2")
puts "hello #{name}"
end
work well
- Tracker changed from Backport to Feature
- Project changed from Backport200 to Ruby master
- Assignee set to nobu (Nobuyoshi Nakada)
Backport from where?
Order is:
(1) Modify trunk
(2) Backport to 2.0.0
BTW, I +1 for this proposal.
- Tracker changed from Feature to Bug
Moving to bug.
def foo x, opt:42; end # => ok
def foo opt:42; end # => syntax error, should be ok
def foo( opt:42); end # => ok
- Category set to core
- Target version set to 2.1.0
- ruby -v set to -v
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r39504.
jy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
parse.y: keyword argument without paren
- parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
after method definition without a parenthesis. [ruby-core:52820]
[Bug #7942]
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport200
- Category deleted (
core)
- Status changed from Closed to Assigned
- Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
- Target version deleted (
2.1.0)
- Subject changed from keyword arguments must use with quot? to keyword arguments must use with paren?
- Status changed from Assigned to Closed
This issue was solved with changeset r39708.
jy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 39504: [Backport #7942]
* parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
after method definition without a parenthesis. [ruby-core:52820]
[Bug #7942]
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0