From: "niku (niku _) via ruby-core" Date: 2025-08-31T06:55:18+00:00 Subject: [ruby-core:123145] [Ruby Bug#21558] Regexp.union with multiple regexps returns a non-shareable object (should be shareable if possible) Issue #21558 has been updated by niku (niku _). I've found an issue that already talked about it https://bugs.ruby-lang.org/issues/17256. ---------------------------------------- Bug #21558: Regexp.union with multiple regexps returns a non-shareable object (should be shareable if possible) https://bugs.ruby-lang.org/issues/21558#change-114478 * Author: niku (niku _) * Status: Feedback * ruby -v: ruby 3.5.0dev (2025-08-30T18:24:25Z master 5c7dfe85a1) +PRISM [arm64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Regexp.union returns a non-shareable object when given multiple Regex arguments. Is this expected behavior? It would be preferable if the resulting Regexp were shareable, since single-argument `Regexp.union` does produce a shareable object. ```irb irb(main):001> a = /a/ => /a/ irb(main):002> b = Regexp.union(a) => /a/ irb(main):003> c = Regexp.union(a, a) => /(?-mix:a)|(?-mix:a)/ irb(main):004> Ractor.shareable?(a) => true irb(main):005> Ractor.shareable?(b) => true irb(main):006> Ractor.shareable?(c) => 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/