diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 08:45:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 08:45:13 +0000 |
commit | f77c97a8ca966ba2a0303b838fa7e04ebc311ecb (patch) | |
tree | 8973d62e7390b1e6374aea6808368e77e7377c2b /variable.c | |
parent | 5cab66cbcfd2c1d1b1da916b7e7b2be8b41cc06a (diff) | |
download | ruby-f77c97a8ca966ba2a0303b838fa7e04ebc311ecb.tar.gz |
variable.c: show namespace
* variable.c (rb_const_set): show namespace in warning messages.
[Feature #7190]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/variable.c b/variable.c index 9a4be56497..601efb955d 100644 --- a/variable.c +++ b/variable.c @@ -2136,7 +2136,11 @@ rb_const_set(VALUE klass, ID id, VALUE val) else { const char *name = rb_id2name(id); visibility = ce->flag; - rb_warn("already initialized constant %s", name); + if (klass == rb_cObject) + rb_warn("already initialized constant %s", name); + else + rb_warn("already initialized constant %s::%s", + rb_class2name(klass), name); if (!NIL_P(ce->file) && ce->line) { rb_compile_warn(RSTRING_PTR(ce->file), ce->line, "previous definition of %s was here", name); |