diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-17 00:14:48 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-17 00:14:48 +0900 |
| commit | 0e50d8e8f4aae2dfdc8ef70e5c262f523d0bd152 (patch) | |
| tree | ec4c9653f7ebf2ffb9eeec1ad0694b0388fab60d /src | |
| parent | 4821ea7c67bab7388b59d0e1dcd7307a0e210aa3 (diff) | |
| parent | 066c2772e88dff2fcdf11c18d6396b5055cc7b61 (diff) | |
| download | mruby-0e50d8e8f4aae2dfdc8ef70e5c262f523d0bd152.tar.gz mruby-0e50d8e8f4aae2dfdc8ef70e5c262f523d0bd152.zip | |
Merge pull request #2264 from ksss/const_missing
const_missing error message more detail
Diffstat (limited to 'src')
| -rw-r--r-- | src/class.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/class.c b/src/class.c index a4f9f2873..f6f936c39 100644 --- a/src/class.c +++ b/src/class.c @@ -1890,8 +1890,16 @@ mrb_mod_const_missing(mrb_state *mrb, mrb_value mod) mrb_sym sym; mrb_get_args(mrb, "n", &sym); - mrb_name_error(mrb, sym, "uninitialized constant %S", - mrb_sym2str(mrb, 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_sym2str(mrb, sym)); + } /* not reached */ return mrb_nil_value(); } |
