Commit 066c2772 authored by ksss's avatar ksss

const_missing error message more detail

parent 60051de4
...@@ -1890,8 +1890,16 @@ mrb_mod_const_missing(mrb_state *mrb, mrb_value mod) ...@@ -1890,8 +1890,16 @@ mrb_mod_const_missing(mrb_state *mrb, mrb_value mod)
mrb_sym sym; mrb_sym sym;
mrb_get_args(mrb, "n", &sym); mrb_get_args(mrb, "n", &sym);
if (mrb_class_real(mrb_class_ptr(mod)) != mrb->object_class) {
mrb_name_error(mrb, sym, "uninitialized constant %S::%S",
mod,
mrb_sym2str(mrb, sym));
}
else {
mrb_name_error(mrb, sym, "uninitialized constant %S", mrb_name_error(mrb, sym, "uninitialized constant %S",
mrb_sym2str(mrb, sym)); mrb_sym2str(mrb, sym));
}
/* not reached */ /* not reached */
return mrb_nil_value(); return mrb_nil_value();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment