diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-25 01:16:05 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-10-25 01:16:05 +0900 |
commit | b609bdeb5307e280137b4b2838af0fe4e4b46f1c (patch) | |
tree | 65434e9c844163b6f300b5eb256731e9bb0d2b67 /compile.c | |
parent | 4b3e007e0778415e75ec2f0afcdc559eea43fdf8 (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |