From a669f1f992105981efd4bb891d34cbf53b05696a Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 26 Sep 2016 14:58:41 +0000 Subject: merge revision(s) 56117,56118: [Backport #12742] * variable.c (rb_const_search): raise with the actual class/module name which defines the private constant. * variable.c (rb_const_search): warn with the actual class/module name which defines the deprecated constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 3690c1bddd..618aa852bd 100644 --- a/variable.c +++ b/variable.c @@ -2238,9 +2238,9 @@ rb_const_get_0(VALUE klass, ID id, int exclude, int recurse, int visibility) while ((ce = rb_const_lookup(tmp, id))) { if (visibility && RB_CONST_PRIVATE_P(ce)) { rb_name_err_raise("private constant %2$s::%1$s referenced", - klass, ID2SYM(id)); + tmp, ID2SYM(id)); } - rb_const_warn_if_deprecated(ce, klass, id); + rb_const_warn_if_deprecated(ce, tmp, id); value = ce->value; if (value == Qundef) { if (am == tmp) break; -- cgit v1.2.3