Skip to content

Commit

Permalink
change CLASS_NEW_INSTANCE macro to call .new
Browse files Browse the repository at this point in the history
so that if .new gets overridden, it gets properly called
  • Loading branch information
HoneyryderChuck committed Oct 15, 2024
1 parent bee8167 commit 36a3d5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/rbs_extension/ruby_objs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifdef RB_PASS_KEYWORDS
// Ruby 2.7 or later
#define CLASS_NEW_INSTANCE(klass, argc, argv)\
rb_class_new_instance_kw(argc, argv, klass, RB_PASS_KEYWORDS)
rb_respond_to(klass, rb_intern("new")) ? rb_funcallv_kw(klass, rb_intern("new"), argc, argv, RB_PASS_KEYWORDS) : rb_class_new_instance_kw(argc, argv, klass, RB_PASS_KEYWORDS)
#else
// Ruby 2.6
#define CLASS_NEW_INSTANCE(receiver, argc, argv)\
Expand Down

0 comments on commit 36a3d5f

Please sign in to comment.