[ruby-core:96353] [Ruby master Feature#16433] Proposal: Output warning if `_1` is used in parameter name
| Newsgroups | gmane.comp.lang.ruby.core |
|---|---|
| Message-ID | <redmine.journal-83264.20191220011933.1e580e12cc93dcc5@ruby-lang.org> |
Issue #16433 has been updated by osyo (manga osyo). Thanks! ---------------------------------------- Feature #16433: Proposal: Output warning if `_1` is used in parameter name https://bugs.ruby-lang.org/issues/16433#change-83264 * Author: osyo (manga osyo) * Status: Closed * Priority: Normal * Assignee: * Target version: ---------------------------------------- Currently, output warning if local variable name is `_1`. ```ruby # warning: `_1' is used as numbered parameter _1 = 42 ``` However, if parameter name is `_1`, no output warning is issued. ```ruby # 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`. ```ruby # Expected behavior # warning: `_1' is used as numbered parameter def hoge(_1); end ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>