diff options
author | Jeremy Evans <[email protected]> | 2019-11-28 17:28:13 -0800 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-11-29 20:32:03 +0200 |
commit | 0c273b2279e65c57161e0859f2d4e9f6e649b751 (patch) | |
tree | d7e85eace218625a43a85eb1c7c1d30c6e117d88 /variable.c | |
parent | 8a1f313e2e6ecf43a1ccad6cca35f738c6052b3c (diff) |
Supress class variable overtaken warning when original modules are the same
This issue was exposed by recent commits to better support including
refined modules.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2709
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c index 9919e48480..9c50b75c60 100644 --- a/variable.c +++ b/variable.c @@ -3025,7 +3025,7 @@ cvar_overtaken(VALUE front, VALUE target, ID id) if (front && target != front) { st_data_t did = (st_data_t)id; - if (RTEST(ruby_verbose)) { + if (RTEST(ruby_verbose) && original_module(front) != original_module(target)) { rb_warning("class variable % "PRIsVALUE" of %"PRIsVALUE" is overtaken by %"PRIsVALUE"", ID2SYM(id), rb_class_name(original_module(front)), rb_class_name(original_module(target))); |