Permalink
Browse files

Fix Struct.new and Struct.[].

Instances of Struct's subclass should have MRB_TT_STRUCT.
  • Loading branch information...
1 parent a194f30 commit 7a17377c644d421fae71bd8d61e6f7dc744faf62 @masamitsu-murase masamitsu-murase committed Jun 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/struct.c
View
@@ -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);

0 comments on commit 7a17377

Please sign in to comment.