From: nobu@... Date: 2020-12-17T03:42:00+00:00 Subject: [ruby-core:101490] [Ruby master Feature#17397] `shareable_constant_value: literal` should check at runtime, not at parse time Issue #17397 has been updated by nobu (Nobuyoshi Nakada). Your proposal seems `shareable_constant_value: everything` (it's prefixed with `experimental_` now though). ---------------------------------------- Feature #17397: `shareable_constant_value: literal` should check at runtime, not at parse time https://bugs.ruby-lang.org/issues/17397#change-89268 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) ---------------------------------------- I think `shareable_constant_value: literal` is too strict because it has too crude checks at parse time. I wish the following code would parse and run: ```ruby # shareable_constant_value: literal class Foo < RuntimeError end # Similar code, but does not parse: Bar = Class.new(RuntimeError) # => unshareable expression Baz = Ractor.make_shareable(anything_here) # => unshareable expression Qux = Set[1, 2, 3].freeze # => unshareable expression ``` Could we instead raise some sort of RuntimeError when an assignment is made that is not shareable? -- https://bugs.ruby-lang.org/ Unsubscribe: