Project

General

Profile

Bug #22378

Updated by Earlopain (Earlopain _) 5 days ago

```rb 
 # Reduced from the `httpx` gem 
 @var = Class.new.freeze.dup 
 @var.instance_variable_set(:@test, 123) 
 ``` 

 I expect this code to succeed. dup returns an unfrozen copy, so I should be able to set instance variables on it. However, I get the following error even though the code is ractor-free: 

 ``` 
 test.rb:2:in 'Kernel#instance_variable_set': can't modify instance variables of a shareable Class (Ractor::IsolationError) 
 ``` 

 It works on 4.0 but fails on current master. Caused by #22291 Behaviour changed recently, maybe #22291, but I haven't confirmed it. 

Back