summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2021-01-09 12:18:14 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-09 13:33:33 +0900
commit7ff0e93f96cc55467d791ebc841f12f9130bf181 (patch)
tree652c6f7f4c7e0439ede65ce17ac8b5c7c8bcfc6c /parse.y
parent1a3343cfdcb765b94bf63375d45618130d6b92c9 (diff)
parse.y: handle "duplicated argument name" appropriately on ripper.y
refs: 733ed1e184
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index ff00fa8e35d..cdd64f7071a 100644
--- a/parse.y
+++ b/parse.y
@@ -7871,7 +7871,9 @@ formal_argument(struct parser_params *p, ID lhs)
formal_argument(struct parser_params *p, VALUE lhs)
#endif
{
- switch (id_type(get_id(lhs))) {
+ ID id = get_id(lhs);
+
+ switch (id_type(id)) {
case ID_LOCAL:
break;
#ifndef RIPPER
@@ -7896,7 +7898,7 @@ formal_argument(struct parser_params *p, VALUE lhs)
return 0;
#undef ERR
}
- shadowing_lvar(p, lhs);
+ shadowing_lvar(p, id);
return lhs;
}