summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index e94659d85d..f0458a3520 100644
--- a/struct.c
+++ b/struct.c
@@ -210,7 +210,7 @@ make_struct(name, members, klass)
rb_define_singleton_method(nstr, "members", rb_struct_s_members_m, 0);
for (i=0; i< RARRAY(members)->len; i++) {
ID id = SYM2ID(RARRAY(members)->ptr[i]);
- if (rb_is_local_id(id)) {
+ if (rb_is_local_id(id) || rb_is_const_id(id)) {
if (i<sizeof(ref_func)) {
rb_define_method_id(nstr, id, ref_func[i], 0);
}
@@ -496,7 +496,7 @@ inspect_struct(s, dummy, recur)
}
slot = RARRAY(members)->ptr[i];
id = SYM2ID(slot);
- if (rb_is_local_id(id)) {
+ if (rb_is_local_id(id) || rb_is_const_id(id)) {
p = rb_id2name(id);
rb_str_cat2(str, p);
}