Skip to content

Commit

Permalink
Refined the warning message for $, and $;
Browse files Browse the repository at this point in the history
[Bug #16438]
  • Loading branch information
nobu committed Dec 20, 2019
1 parent 7a94225 commit 2b2030f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion io.c
Expand Up @@ -7543,7 +7543,7 @@ rb_output_fs_setter(VALUE val, ID id, VALUE *var)
{
rb_str_setter(val, id, &val);
if (!NIL_P(val)) {
rb_warn("non-nil $, will be deprecated");
rb_warn_deprecated("`$,'", NULL);
}
*var = val;
}
Expand Down
2 changes: 1 addition & 1 deletion string.c
Expand Up @@ -10092,7 +10092,7 @@ rb_fs_setter(VALUE val, ID id, VALUE *var)
rb_id2str(id));
}
if (!NIL_P(val)) {
rb_warn("non-nil $; will be deprecated");
rb_warn_deprecated("`$;'", NULL);
}
*var = val;
}
Expand Down
2 changes: 1 addition & 1 deletion test/ruby/test_string.rb
Expand Up @@ -1771,7 +1771,7 @@ def test_fs

begin
fs = $;
assert_warn(/\$; will be deprecated/) {$; = " "}
assert_warn(/`\$;' is deprecated/) {$; = " "}
ensure
EnvUtil.suppress_warning {$; = fs}
end
Expand Down

0 comments on commit 2b2030f

Please sign in to comment.