Project

General

Profile

Actions

Bug #17531

open

`did_you_mean` not Ractor friendly

Added by marcandre (Marc-Andre Lafortune) 4 months ago. Updated 3 months ago.

Status:
Open
Priority:
Normal
Target version:
-
[ruby-core:102037]

Description

The gem did_you_mean uses a class instance variable that does not work with Ractor.

$ RUBYOPT='--disable-did_you_mean' ruby -W0 -e 'Ractor.new{ begin ; nil + 42; rescue Exception => e; e.to_s end}.take'
# => prints nothing (ok)

$ ruby -W0 -e 'Ractor.new{ begin ; nil + 42; rescue Exception => e; e.to_s end}.take'
# Prints
/Users/mal/.rbenv/versions/3.0.0/lib/ruby/3.0.0/did_you_mean.rb:102:in `formatter'
/Users/mal/.rbenv/versions/3.0.0/lib/ruby/3.0.0/did_you_mean/core_ext/name_error.rb:9:in `to_s'
-e:1:in `rescue in block in <main>'
-e:1:in `block in <main>'
# (not ok)

Updated by marcandre (Marc-Andre Lafortune) 4 months ago

Typo: I meant a class variable, not a class instance variable.

Updated by ko1 (Koichi Sasada) 3 months ago

  • Assignee changed from yuki24 (Yuki Nishijima) to ko1 (Koichi Sasada)
Actions

Also available in: Atom PDF