Reword keyword arguments warning messages to convey these are deprecation warnings

This commit is contained in:
Marc-Andre Lafortune 2019-12-23 02:34:16 -05:00
parent df6f5c44af
commit 819b604037
14 changed files with 501 additions and 501 deletions

View file

@ -2051,7 +2051,7 @@ rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, st
if (!keyword_given && !last_hash_keyword) {
/* Warn if treating positional as keyword, as in Ruby 3,
this will be an error */
rb_warn("The last argument is used as keyword parameters");
rb_warn("Using the last argument as keyword parameters is deprecated");
}
argc--;
}
@ -2066,7 +2066,7 @@ rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, st
}
else if (arg->f_hash && keyword_given && arg->n_mand == argc) {
/* Warn if treating keywords as positional, as in Ruby 3, this will be an error */
rb_warn("The keyword argument is passed as the last hash parameter");
rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
}
}
if (arg->f_hash && arg->n_mand == argc+1 && empty_keyword_given) {
@ -2075,7 +2075,7 @@ rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, st
ptr[argc] = rb_hash_new();
argc++;
*(&argv) = ptr;
rb_warn("The keyword argument is passed as the last hash parameter");
rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
}
arg->argc = argc;