Skip to content

Commit c3337ad

Browse files
authored
Merge pull request #2848 from trinistr/patch-1
Add variants with positional argument to `Hash#transform_keys`
2 parents abd0b4f + aa279f3 commit c3337ad

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/hash.rbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,9 @@ class Hash[unchecked out K, unchecked out V] < Object
18701870
# Values](rdoc-ref:Hash@Methods+for+Transforming+Keys+and+Values).
18711871
#
18721872
def transform_keys: () -> Enumerator[K, Hash[untyped, V]]
1873+
| [A] (Hash[K, A]) -> Hash[A, V]
18731874
| [A] () { (K) -> A } -> Hash[A, V]
1875+
| [A] (Hash[K, A]) { (K) -> A } -> Hash[A, V]
18741876

18751877
# <!--
18761878
# rdoc-file=hash.c
@@ -1963,7 +1965,9 @@ class Hash[unchecked out K, unchecked out V] < Object
19631965
# Values](rdoc-ref:Hash@Methods+for+Transforming+Keys+and+Values).
19641966
#
19651967
def transform_keys!: () -> Enumerator[K, self]
1968+
| (Hash[K, K]) -> self
19661969
| () { (K) -> K } -> self
1970+
| (Hash[K, K]) { (K) -> K } -> self
19671971

19681972
# <!--
19691973
# rdoc-file=hash.c

0 commit comments

Comments
 (0)