From a38168bc375b57bee18f80f5c4d3e67f1447010d Mon Sep 17 00:00:00 2001 From: Soutaro Matsumoto Date: Fri, 27 Dec 2024 13:45:09 +0900 Subject: [PATCH] Fix `Ractor.store_if_absent` It in fact yields `nil`. Added `nil` in block parameter for testing. --- core/ractor.rbs | 2 +- test/stdlib/Ractor_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/ractor.rbs b/core/ractor.rbs index 731e835a2..eb50e1229 100644 --- a/core/ractor.rbs +++ b/core/ractor.rbs @@ -603,7 +603,7 @@ class Ractor # } # }.map(&:value).uniq.size #=> 1 and f() is called only once # - def self.store_if_absent: (Symbol) { () -> untyped } -> untyped + def self.store_if_absent: [A] (Symbol) { (nil) -> A } -> A #