mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Update exception message in string_for_symbol
This is a static function only called in two places (rb_to_id and rb_to_symbol), and in both places, both symbols and strings are allowed. This makes the error message consistent with rb_check_id and rb_check_symbol. Fixes [Bug #20607]
This commit is contained in:
parent
268c72377b
commit
8dc0d2904a
Notes:
git
2024-09-19 04:29:23 +00:00
4 changed files with 9 additions and 9 deletions
2
string.c
2
string.c
|
@ -12398,7 +12398,7 @@ string_for_symbol(VALUE name)
|
|||
if (!RB_TYPE_P(name, T_STRING)) {
|
||||
VALUE tmp = rb_check_string_type(name);
|
||||
if (NIL_P(tmp)) {
|
||||
rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol",
|
||||
rb_raise(rb_eTypeError, "%+"PRIsVALUE" is not a symbol nor a string",
|
||||
name);
|
||||
}
|
||||
name = tmp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue