Project

General

Profile

Actions

Bug #20423

closed

Anonymous block forwarding shouldn't work with ... but it does

Added by tenderlovemaking (Aaron Patterson) 19 days ago. Updated 18 days ago.

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

Description

According to this note, anonymous block forwarding should only be supported when explicitly used in the method signature.

For example:

def foo(&) = bar(&) # OK
def foo = bar(&)    # NG

However, if you use ... in the method signature, & seems to work:

def foo(...)
  # bar(*) # Syntax Error
  # bar(**) # Syntax Error
  bar(&) # not a syntax error, but I think it should be
end

I think this should be a syntax error.

Actions #2

Updated by nobu (Nobuyoshi Nakada) 18 days ago

  • Status changed from Open to Closed

Applied in changeset git|e36988450e9e9ccccb41c72135f1e57790920668.


[Bug #20423] Disallow anonymous block within argument forwarding

Actions

Also available in: Atom PDF

Like0
Like0Like0