Support Marshal.{dump,load} for core Set

This was missed when adding core Set, because it's handled
implicitly for T_OBJECT.

Keep marshal compatibility between core Set and stdlib Set,
so you can unmarshal core Set with stdlib Set and vice versa.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
Jeremy Evans 2025-04-29 00:38:35 +09:00 committed by GitHub
parent 80a1a1bb8a
commit 926411171d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
Notes: git 2025-04-28 15:38:51 +00:00
Merged: https://github.com/ruby/ruby/pull/13185

Merged-By: jeremyevans <code@jeremyevans.net>
4 changed files with 95 additions and 1 deletions

2
hash.c
View file

@ -2253,7 +2253,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
* See {Hash Default}[rdoc-ref:Hash@Hash+Default].
*/
static VALUE
VALUE
rb_hash_set_default(VALUE hash, VALUE ifnone)
{
rb_hash_modify_check(hash);