[ruby-core:101966] [Ruby master Bug#17513] Methods of shareable objects and UnboundMethods should be shareable
From:
eregontp@...
Date:
2021-01-06 19:16:39 UTC
List:
ruby-core #101966
Issue #17513 has been updated by Eregon (Benoit Daloze).
Methods can be defined via `define_method { capture_state }` and so rely on mutable state, so I guess this is only OK for `def` methods.
----------------------------------------
Bug #17513: Methods of shareable objects and UnboundMethods should be shareable
https://bugs.ruby-lang.org/issues/17513#change-89819
* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: 3.0.0p0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
```ruby
class Foo
def foo
end
end
f = Foo.new.freeze
Ractor.shareable?(f) # => true
Ractor.make_shareable(f.method(:foo).to_proc) # => Proc, ok
Ractor.make_shareable(f.method(:foo)) # => Ractor::Error, expected Method
Ractor.make_shareable(Foo.instance_method(:foo)) # => Ractor::Error, expected UnboundMethod
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>