Project

General

Profile

Actions

Feature #17393

open

`Ractor::Moved#inspect`

Added by marcandre (Marc-Andre Lafortune) over 3 years ago. Updated over 3 years ago.

Status:
Open
Target version:
-
[ruby-core:101455]

Description

It could be helpful to define Ractor::Moved#inspect and output the source location of when the data was moved. If preferred, it could raise an error with this information:

x = []
Ractor.new{ receive }.send(x, move: true)
p x # => "Data was moved in `example.rb:4`"
# or
p x # => "Data was moved in `example.rb:4`" (Ractor::MovedError)

Also @zverok (Victor Shepelev) and myself were wondering if there was a technical reason to freeze Ractor::Moved? If not, is it only to "force" people to use refinements (which are allowed on frozen classes)? It's already known that it is in general a bad idea to modify builtin classes, so it's not clear to me that freezing that class is best.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0