From 22f23a378b2d9f6101fa63667a7e13ab56d3568b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 30 Sep 2024 18:57:34 +0900 Subject: [PATCH] stdlib: Make the block arguments of Kernel#proc untyped This changes the block argument of `Kernel#proc` to UntypedFunction. Then the arguments of the block become untyped instead of nil. It allows users to override the type via comment annotation. For example: ``` proc do |a, b, c| # @type var a: String # @type var b: Integer # @type var c: Symbol end ``` I found this problem on the Steep repo. https://github.com/soutaro/steep/blob/v1.8.0/lib/steep.rb#L169-L176 --- core/kernel.rbs | 2 +- test/stdlib/Kernel_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/kernel.rbs b/core/kernel.rbs index dd1f624fd..f97b66fd6 100644 --- a/core/kernel.rbs +++ b/core/kernel.rbs @@ -1209,7 +1209,7 @@ module Kernel : BasicObject # --> # Equivalent to Proc.new. # - def self?.proc: () { () -> untyped } -> Proc + def self?.proc: () { (?) -> untyped } -> Proc #