Project

General

Profile

Actions

Bug #15825

closed

Fix a case where numbered parameters should not be allowed

Added by jeremyevans0 (Jeremy Evans) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-05-05 trunk 84e71e9fc1) [x86_64-openbsd]
[ruby-core:92543]

Description

Because proc{|| @1} is a syntax error, the following should
also be syntax errors:

proc { |  
| @1}

proc { |; a| @1 }

The attached patch makes both of those cases syntax errors.


Files

fix-numbered-parameters-opt_bv_decl.patch (1.49 KB) fix-numbered-parameters-opt_bv_decl.patch jeremyevans0 (Jeremy Evans), 05/05/2019 04:38 AM

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

Probably I might think the latter case could be allowed (and forgot to separate these cases), but it doesn't seem worth complicating.

Actions #2

Updated by jeremyevans (Jeremy Evans) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset git|b8f3be295b694964e88960c0228459b8aadd114a.


Fix a case where numbered parameters should not be allowed

Because proc{|| @1} is a syntax error, the following should
also be syntax errors:

proc { |
| @1}
proc { |; a| @1 }

This fixes both cases.

[Bug #15825]

Actions

Also available in: Atom PDF

Like0
Like0Like0