Project

General

Profile

Actions

Bug #17858

closed

Trailing comma after a `&block` parameter cause a syntax error

Added by byroot (Jean Boussier) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:103797]

Description

Something I just noticed:

some_long_method(
  1,
  &block, # syntax error, unexpected ',', expecting ')'
)

Which seems inconsistent to me as it works for regular parameters:

some_long_method(
  1,
  2,
)

I'm not sure if this is an intended limitation or just an oversight.


Related issues 1 (1 open0 closed)

Related to Ruby master - Feature #19107: Allow trailing comma in method signatureOpenActions

Updated by matz (Yukihiro Matsumoto) over 3 years ago

  • Status changed from Open to Closed

It is intended. &block argument must come at the end of arguments. Nothing comes after.

Matz.

Actions #2

Updated by byroot (Jean Boussier) almost 2 years ago

  • Related to Feature #19107: Allow trailing comma in method signature added
Actions

Also available in: Atom PDF

Like0
Like0Like0