diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-11-30 16:07:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 16:07:36 +0900 |
commit | 930a135524382ddd80c0608a7593b6cdfceee846 (patch) | |
tree | 657d033875f462a3b8b9571a30d9657e08ae08b9 /bootstraptest/test_ractor.rb | |
parent | 555bd83a8e8b1e859f698089cbbd9ad938159a0e (diff) | |
download | ruby-930a135524382ddd80c0608a7593b6cdfceee846.tar.gz |
Fixed Ractor.shareable? on cross-recursive objects [Bug #17344]
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r-- | bootstraptest/test_ractor.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index d5d78d7ad9..6bd00d546f 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -975,6 +975,15 @@ assert_equal 'true', %q{ Ractor.shareable?(pr) } +# Ractor.shareable?(recursive_objects) +assert_equal '[false, false]', %q{ + y = [] + x = [y, {}].freeze + y << x + y.freeze + [Ractor.shareable?(x), Ractor.shareable?(y)] +} + # define_method() can invoke different Ractor's proc if the proc is shareable. assert_equal '1', %q{ class C |