From ffaca43b3f3e837d354ef4ffde89e1cc3a98da59 Mon Sep 17 00:00:00 2001 From: ksss Date: Thu, 28 Dec 2023 11:52:27 +0900 Subject: [PATCH] Fix Integer#pow signature --- core/integer.rbs | 7 ++++--- test/stdlib/Integer_test.rb | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/core/integer.rbs b/core/integer.rbs index 76a5616bf..f20d26d39 100644 --- a/core/integer.rbs +++ b/core/integer.rbs @@ -1028,9 +1028,10 @@ class Integer < Numeric # a.pow(b) #=> same as a**b # a.pow(b, m) #=> same as (a**b) % m, but avoids huge temporary values # - def pow: (Integer other, ?Integer modulo) -> Integer - | (Float) -> Float - | (Rational) -> Rational + def pow: (Integer other) -> (Integer | Rational) + | (Integer other, Integer modulo) -> Integer + | (Float) -> (Float | Complex) + | (Rational) -> (Float | Rational | Complex) | (Complex) -> Complex #