Project

General

Profile

Actions

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

Actions #1

Updated by ko1 (Koichi Sasada) over 11 years ago

  • 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.

Actions #2

Updated by marcandre (Marc-Andre Lafortune) over 11 years ago

  • 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

Updated by ko1 (Koichi Sasada) over 11 years ago

  • Category set to core
  • Target version set to 2.1.0
  • ruby -v set to -v
Actions #4

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • 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]
Actions #5

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • 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)
Actions #6

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

  • Subject changed from keyword arguments must use with quot? to keyword arguments must use with paren?
Actions #7

Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago

  • 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]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0