Fix constant name of `Ractor::IsolationError` message
commitea91ab696e6ee7225a2dde909e60dd9d0b241935
authoryui-knk <[email protected]>
Sat, 6 Jan 2024 08:33:20 +0000 (6 17:33 +0900)
committerYuichiro Kaneko <[email protected]>
Sat, 10 Feb 2024 00:23:17 +0000 (10 09:23 +0900)
tree47963367b2840fc1b425d47eee15cc7c59c1dbdd
parentbf72cb84ca52bc062cc1711c03622ed6c928fed8
Fix constant name of `Ractor::IsolationError` message

`dest` of `const_decl_path` is `NODE_COLON2` or `NODE_COLON3` in some cases.
For example, `B::C ||= [“Not ” + “shareable”]` passes `NODE_COLON2`
and `::C ||= [“Not ” + “shareable”]` passes `NODE_COLON3`.
This commit fixes `Ractor::IsolationError` message for such case.

```
# shareable_constant_value: literal
::C ||= ["Not " + "shareable"]

# Before
# => cannot assign unshareable object to C (Ractor::IsolationError)

# After
# => cannot assign unshareable object to ::C (Ractor::IsolationError)
```
ruby_parser.c
test/ruby/test_parse.rb