From: "mame (Yusuke Endoh) via ruby-core" Date: 2023-09-12T08:09:09+00:00 Subject: [ruby-core:114693] [Ruby master Bug#19765] Ractor.make_shareable ignores self of a proc created from a Method Issue #19765 has been updated by mame (Yusuke Endoh). Assignee set to ko1 (Koichi Sasada) ---------------------------------------- Bug #19765: Ractor.make_shareable ignores self of a proc created from a Method https://bugs.ruby-lang.org/issues/19765#change-104523 * Author: Ethan (Ethan -) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.0dev (2023-07-12T00:26:03Z master dfe782be17) [x86_64-darwin21] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- An unshareable receiver of a Proc or a Method will cause make_shareable to error, but this does not happen with a proc from Method#to_proc: ```ruby str = "" a = str.instance_exec { proc { to_s } } Ractor.make_shareable a # => :820:in `make_shareable': Proc's self is not shareable: # (Ractor::IsolationError) b = str.instance_exec { method(:to_s) } Ractor.make_shareable b # => :820:in `make_shareable': can not make shareable object for # (Ractor::Error) c = str.instance_exec { method(:to_s).to_proc } Ractor.make_shareable c c.call # => "" str[0] = "!" c.call # => "!" ``` Related, maybe: #19372 #19374 Tangential: why does Proc cause Ractor::IsolationError but Method causes Ractor::Error? -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/