summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index 77c1c372401..76c0939c46a 100644
--- a/variable.c
+++ b/variable.c
@@ -1548,6 +1548,9 @@ rb_define_const(klass, name, val)
{
ID id = rb_intern(name);
+ if (!rb_is_const_id(id)) {
+ rb_warn("rb_define_const: invalide name `%s' for constant", name);
+ }
if (klass == rb_cObject) {
rb_secure(4);
}