Project

General

Profile

Actions

Bug #20472

open

Ractor support for ** into hash literal

Bug #20472: Ractor support for ** into hash literal

Added by kddnewton (Kevin Newton) over 1 year ago. Updated 6 months ago.

Status:
Assigned
Assignee:
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) about 1 year ago ยท Edited Actions #1 [ruby-core:119113]

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 1 year ago Actions #2 [ruby-core:119344]

  • Assignee set to ko1 (Koichi Sasada)

Updated by hsbt (Hiroshi SHIBATA) 12 months ago Actions #3

  • Status changed from Open to Assigned

Updated by jhawthorn (John Hawthorn) 6 months ago Actions #4

  • Assignee changed from ko1 (Koichi Sasada) to ractor
Actions

Also available in: PDF Atom