summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index bf48e711f0..bde8937486 100644
--- a/variable.c
+++ b/variable.c
@@ -2672,6 +2672,22 @@ autoload_try_load(VALUE _arguments)
result = Qfalse;
rb_const_remove(arguments->module, arguments->name);
+
+ if (arguments->module == rb_cObject) {
+ rb_warning(
+ "Expected %"PRIsVALUE" to define %"PRIsVALUE" but it didn't",
+ arguments->autoload_data->feature,
+ ID2SYM(arguments->name)
+ );
+ }
+ else {
+ rb_warning(
+ "Expected %"PRIsVALUE" to define %"PRIsVALUE"::%"PRIsVALUE" but it didn't",
+ arguments->autoload_data->feature,
+ arguments->module,
+ ID2SYM(arguments->name)
+ );
+ }
}
else {
// Otherwise, it was loaded, copy the flags from the autoload constant: