Project

General

Profile

Actions

Bug #20472

open

Ractor support for ** into hash literal

Added by kddnewton (Kevin Newton) 7 months ago. Updated 10 days ago.

Status:
Assigned
Target version:
-
[ruby-core:117781]

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)
Actions #3

Updated by hsbt (Hiroshi SHIBATA) 10 days ago

  • Status changed from Open to Assigned
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0