Fix hash to keyword warning to apply in all cases
Previously, it only applied if the call had more positional arguments than the method it was calling accepted.
This commit is contained in:
parent
334b41a46b
commit
3f67fcd3d5
Notes:
git
2019-08-31 04:40:18 +09:00
@ -676,8 +676,7 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
|
||||
given_argc--;
|
||||
}
|
||||
}
|
||||
else if (given_argc > max_argc && max_argc >= 0) {
|
||||
if (args_pop_keyword_hash(args, &keyword_hash)) {
|
||||
else if (args_pop_keyword_hash(args, &keyword_hash)) {
|
||||
/* Warn the following:
|
||||
* def foo(k:1) p [k]; end
|
||||
* foo({k:42}) #=> 42
|
||||
@ -689,7 +688,6 @@ setup_parameters_complex(rb_execution_context_t * const ec, const rb_iseq_t * co
|
||||
given_argc--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (given_argc > max_argc && max_argc != UNLIMITED_ARGUMENTS) {
|
||||
if (arg_setup_type == arg_setup_block) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user