Skip to content

Commit

Permalink
Fix Struct.new and Struct.[].
Browse files Browse the repository at this point in the history
Instances of Struct's subclass should have MRB_TT_STRUCT.
  • Loading branch information
masamitsu-murase committed Jun 23, 2012
1 parent a194f30 commit 7a17377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/struct.c
Expand Up @@ -286,8 +286,8 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k
nstr = mrb_obj_value(c);
mrb_iv_set(mrb, nstr, mrb_intern(mrb, "__members__"), members);

mrb_define_class_method(mrb, c, "new", mrb_class_new_instance_m, ARGS_ANY());
mrb_define_class_method(mrb, c, "[]", mrb_class_new_instance_m, ARGS_ANY());
mrb_define_class_method(mrb, c, "new", mrb_instance_new, ARGS_ANY());
mrb_define_class_method(mrb, c, "[]", mrb_instance_new, ARGS_ANY());
mrb_define_class_method(mrb, c, "members", mrb_struct_s_members_m, ARGS_NONE());
//RSTRUCT(nstr)->basic.c->super = c->c;
ptr_members = RARRAY_PTR(members);
Expand Down

0 comments on commit 7a17377

Please sign in to comment.