Project

General

Profile

Actions

Feature #16433

closed

Proposal: Output warning if `_1` is used in parameter name

Added by osyo (manga osyo) over 4 years ago. Updated over 4 years ago.

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

Description

Currently, output warning if local variable name is _1.

# warning: `_1' is used as numbered parameter
_1 = 42

However, if parameter name is _1, no output warning is issued.

# Actual behavior
# no warning
def hoge(_1);
end

If local variable _1 causes a syntax error in Ruby 3.0(or later ?), I think it is better to output a warning even if you use argument name _1.

# Expected behavior
# warning: `_1' is used as numbered parameter
def hoge(_1);
end
Actions

Also available in: Atom PDF

Like0
Like0Like0