diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2023-11-28 09:26:41 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2023-11-28 17:43:22 -0500 |
| commit | 6eb5a9cf8f99b64d97d26b41011c03b846317d3e (patch) | |
| tree | 7bdbde8c6b60668074d5390db94265cef48a4ece /test/ruby | |
| parent | 49383901772f874569bbdc992867bd02b4b597a8 (diff) | |
Fix Ractor sharing for too complex generic ivars
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_shapes.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index c4b0d251f1..148595ac32 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -621,6 +621,24 @@ class TestShapes < Test::Unit::TestCase end; end + def test_too_complex_generic_ivar_ractor_share + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + $VERBOSE = nil + + RubyVM::Shape.exhaust_shapes + + r = Ractor.new do + o = [] + o.instance_variable_set(:@a, "hello") + Ractor.yield(o) + end + + o = r.take + assert_equal "hello", o.instance_variable_get(:@a) + end; + end + def test_read_iv_after_complex ensure_complex |
