summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-08 04:44:51 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-08 04:44:51 +0000
commitbbd662c8bd85e44957c96d40e4291631554c9b5b (patch)
treea59f1fed74ba4b8c2de1fada66f01edd0c333547 /vm_insnhelper.c
parent0a764c0bb18d5b55f14e02ce6376c6c90734817e (diff)
* insns.def (setclassvariable, setconstant): warn when self is a
refinement. [Bug #10103] [ruby-core:64143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 7169a0f7c1..b4db670b74 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -733,6 +733,14 @@ vm_check_if_namespace(VALUE klass)
}
}
+static inline void
+vm_ensure_not_refinement_module(VALUE self)
+{
+ if (RB_TYPE_P(self, T_MODULE) && FL_TEST(self, RMODULE_IS_REFINEMENT)) {
+ rb_warn("not defined at the refinement, but at the outer class/module");
+ }
+}
+
static inline VALUE
vm_get_iclass(rb_control_frame_t *cfp, VALUE klass)
{