From be45340291c81351b64b80ab3147b343777d4a36 Mon Sep 17 00:00:00 2001 From: SamW Date: Thu, 25 Jul 2024 19:48:34 -0700 Subject: [PATCH] Update Method --- core/method.rbs | 21 +++-- lib/rbs/test/type_check.rb | 6 +- test/stdlib/Method_test.rb | 186 +++++++++++++++++++++++++++---------- 3 files changed, 156 insertions(+), 57 deletions(-) diff --git a/core/method.rbs b/core/method.rbs index cd97e9edd..1433b1ca7 100644 --- a/core/method.rbs +++ b/core/method.rbs @@ -22,9 +22,16 @@ # %w[2017-03-01 2017-03-02].collect(&Date.method(:parse)) # #=> [#, #] # -class Method < Object +class Method type param_types = Array[[:req | :opt | :rest | :keyreq | :key | :keyrest | :block, Symbol] | [:rest | :keyrest | :nokey]] + def ==: (untyped other) -> bool + alias eql? == + def hash: () -> Integer + def dup: () -> instance + def inspect: () -> String + alias to_s inspect + # # Invokes the *meth* with the specified arguments, returning the method's return @@ -90,7 +97,7 @@ class Method < Object # g = proc {|x| x + x } # p (f >> g).call(2) #=> 8 # - def >>: (Proc g) -> Proc + def >>: (Proc::_Callable g) -> Proc # # Invokes the *meth* with the specified arguments, returning the method's return @@ -161,7 +168,7 @@ class Method < Object # m.call # => "bar" # n = m.clone.call # => "bar" # - def clone: () -> Method + def clone: () -> instance #