Should not check/call `to_str` for immediate objects; ref
@@ -1048,6 +1048,7 @@ join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list)
break;
default:
+ if (!mrb_immediate_p(val)) {
tmp = mrb_check_string_type(mrb, val);
if (!mrb_nil_p(tmp)) {
val = tmp;
@@ -1058,6 +1059,7 @@ join_ary(mrb_state *mrb, mrb_value ary, mrb_value sep, mrb_value list)
val = tmp;
goto ary_join;
}
+ }
val = mrb_obj_as_string(mrb, val);
goto str_join;
}
