[ruby-core:96353] [Ruby master Feature#16433] Proposal: Output warning if `_1` is used in parameter name
From:
manga.osyo@...
Date:
2019-12-20 01:19:34 UTC
List:
ruby-core #96353
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:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>