Issue keyword flag warning even with no arguments
If the keyword flag is set, there should be at least one argument, if there isn't, that is a sign the keyword flag was passed when it should not have been.
This commit is contained in:
parent
3073404e74
commit
a8c436d9a1
Notes:
git
2019-09-30 23:07:08 +09:00
@ -256,7 +256,7 @@ rb_adjust_argv_kw_splat(int *argc, const VALUE **argv, int *kw_splat)
|
||||
}
|
||||
}
|
||||
|
||||
if (*kw_splat && *argc > 0 && !RB_TYPE_P((*argv)[(*argc)-1], T_HASH)) {
|
||||
if (*kw_splat && (*argc == 0 || !RB_TYPE_P((*argv)[(*argc)-1], T_HASH))) {
|
||||
rb_warn("Keyword flag passed calling internal method, but last entry is not a hash, unsetting keyword flag");
|
||||
*kw_splat = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user