CARVIEW |
Select Language
HTTP/2 200
x-amz-id-2: sd7O8XePRqHJkvg9GB3cVcTM/1UitYQafC/s7udSVoV2xaguvOdaV1oT4rMK7v56s5QaRNyHDvQKK+BqbP+NaHGDIxAtGaqsNxncdrF/luE=
x-amz-request-id: 0H63CR2Q2S81006G
last-modified: Tue, 27 May 2025 05:41:33 GMT
etag: "6782ab6d9a611cda41ea990a730c9755"
x-amz-server-side-encryption: AES256
server: AmazonS3
content-encoding: gzip
via: 1.1 varnish, 1.1 varnish
content-type: text/plain; charset=utf-8
accept-ranges: bytes
age: 0
date: Wed, 23 Jul 2025 19:59:58 GMT
x-served-by: cache-tyo11941-TYO, cache-bom-vanm7210039-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1753300798.125436,VS0,VE517
vary: Accept-Encoding
content-length: 571
From: "Ethan (Ethan -) via ruby-core"
Date: 2025-05-27T05:30:21+00:00
Subject: [ruby-core:122303] [Ruby Bug#21375] Set[] does not call #initialize
Issue #21375 has been reported by Ethan (Ethan -).
----------------------------------------
Bug #21375: Set[] does not call #initialize
https://bugs.ruby-lang.org/issues/21375
* Author: Ethan (Ethan -)
* Status: Open
* ruby -v: ruby 3.5.0dev (2025-05-26T17:42:35Z master 909a0daab6) +PRISM [x86_64-darwin22]
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
I have a subclass of Set that overrides #initialize. Following #21216, .new does call #initialize but .[] does not.
```ruby
class MySet < Set
def initialize(enum = nil)
compare_by_identity
super
end
end
MySet.new.compare_by_identity?
# => true
MySet[].compare_by_identity?
# => false
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/