Actions
Bug #20472
openRactor support for ** into hash literal
Description
# shareable_constant_value: experimental_copy
a = { "foo" => "bar" }
A = { **a }
In this example, Ruby fails an assertion and crashes. I think we should either provide support for this, or we should explicitly provide a syntax error indicating that ** isn't allowed in constant writes when ractor pragmas are enabled.
Updated by luke-gru (Luke Gruber) 2 months ago ยท Edited
I've created a patch here: https://github.com/luke-gru/ruby/tree/20472 (the latest commit)
For kwsplat, it just calls compile_hash (which generates hash_merge_kw
call after the hash generation), generates a freeze
call on the compiled hash and then calls ensure_shareable
on that hash if shareable_constant_value
is literal
.
Updated by mame (Yusuke Endoh) about 2 months ago
- Assignee set to ko1 (Koichi Sasada)
Updated by hsbt (Hiroshi SHIBATA) 10 days ago
- Status changed from Open to Assigned
Actions
Like0
Like0Like0Like0