Skip to content

Commit 55873c0

Browse files
committed
Add correct behaviour for rb_class2name.
1 parent 1c9f6b9 commit 55873c0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Compatibility:
2929
* Fix `Kernel#sprintf` formatting for `%c` when used non-ASCII encoding (#2369, @andrykonchin).
3030
* Fix `Kernel#sprintf` argument casting for `%c` (@andrykonchin).
3131
* Implement the `rb_enc_strlen` function for use by native extensions (@nirvdrum).
32+
* Match tag values used by `rb_protect` and `rb_jump_tag` for the `tk` gem (#2556, @aardvark179).
33+
* Implement `rb_eval_cmd_kw` to support the `tk` gem (#2556, @aardvark179).
34+
* Fix `rb_class2name` to call `inspect` on anonymous classes like in CRuby (#2701, @aardvark179).
3235

3336
Performance:
3437

src/main/c/cext/class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ VALUE rb_class_name(VALUE ruby_class) {
7171
VALUE name = RUBY_INVOKE(ruby_class, "name");
7272

7373
if (NIL_P(name)) {
74-
return rb_class_name(rb_obj_class(ruby_class));
74+
return RUBY_INVOKE(ruby_class, "inspect");
7575
} else {
7676
return name;
7777
}

0 commit comments

Comments
 (0)