aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-25 01:16:05 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-10-25 01:16:05 +0900
commitb609bdeb5307e280137b4b2838af0fe4e4b46f1c (patch)
tree65434e9c844163b6f300b5eb256731e9bb0d2b67 /compile.c
parent4b3e007e0778415e75ec2f0afcdc559eea43fdf8 (diff)
downloadruby-b609bdeb5307e280137b4b2838af0fe4e4b46f1c.tar.gz
Define arguments forwarding as `ruby2_keywords` style
Get rid of these redundant and useless warnings. ``` $ ruby -e 'def bar(a) a; end; def foo(...) bar(...) end; foo({})' -e:1: warning: The last argument is used as the keyword parameter -e:1: warning: for `foo' defined here -e:1: warning: The keyword argument is passed as the last hash parameter -e:1: warning: for `bar' defined here ```
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 0440ec5fbc..278736d1b1 100644
--- a/compile.c
+++ b/compile.c
@@ -1650,6 +1650,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
EXPECT_NODE("iseq_set_arguments", node_args, NODE_ARGS, COMPILE_NG);
+ body->param.flags.ruby2_keywords = args->ruby2_keywords;
body->param.lead_num = arg_size = (int)args->pre_args_num;
if (body->param.lead_num > 0) body->param.flags.has_lead = TRUE;
debugs(" - argc: %d\n", body->param.lead_num);