rbs 3.10.0 → 4.0.0.dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +3 -3
  3. data/.github/workflows/ruby.yml +24 -35
  4. data/.github/workflows/typecheck.yml +3 -1
  5. data/.github/workflows/windows.yml +2 -2
  6. data/.gitignore +0 -4
  7. data/CHANGELOG.md +0 -88
  8. data/README.md +1 -38
  9. data/Rakefile +20 -142
  10. data/Steepfile +1 -0
  11. data/config.yml +43 -1
  12. data/core/array.rbs +46 -100
  13. data/core/complex.rbs +21 -32
  14. data/core/dir.rbs +2 -2
  15. data/core/encoding.rbs +9 -6
  16. data/core/enumerable.rbs +3 -90
  17. data/core/enumerator.rbs +1 -18
  18. data/core/errno.rbs +0 -8
  19. data/core/errors.rbs +1 -28
  20. data/core/exception.rbs +2 -2
  21. data/core/fiber.rbs +4 -5
  22. data/core/file.rbs +12 -27
  23. data/core/file_test.rbs +1 -1
  24. data/core/float.rbs +22 -209
  25. data/core/gc.rbs +281 -417
  26. data/core/hash.rbs +727 -1024
  27. data/core/integer.rbs +38 -78
  28. data/core/io/buffer.rbs +7 -18
  29. data/core/io/wait.rbs +33 -11
  30. data/core/io.rbs +12 -14
  31. data/core/kernel.rbs +51 -57
  32. data/core/marshal.rbs +1 -1
  33. data/core/match_data.rbs +1 -1
  34. data/core/math.rbs +3 -42
  35. data/core/method.rbs +6 -14
  36. data/core/module.rbs +17 -88
  37. data/core/nil_class.rbs +3 -3
  38. data/core/numeric.rbs +16 -16
  39. data/core/object.rbs +3 -3
  40. data/core/object_space.rbs +15 -21
  41. data/core/proc.rbs +8 -15
  42. data/core/process.rbs +2 -2
  43. data/core/ractor.rbs +437 -278
  44. data/core/range.rbs +8 -7
  45. data/core/rational.rbs +24 -37
  46. data/core/rbs/unnamed/argf.rbs +2 -2
  47. data/core/rbs/unnamed/env_class.rbs +1 -1
  48. data/core/rbs/unnamed/random.rbs +2 -4
  49. data/core/regexp.rbs +20 -25
  50. data/core/ruby_vm.rbs +4 -6
  51. data/core/rubygems/errors.rbs +70 -3
  52. data/core/rubygems/rubygems.rbs +79 -11
  53. data/core/rubygems/version.rbs +3 -2
  54. data/core/set.rbs +359 -488
  55. data/core/string.rbs +1228 -3153
  56. data/core/struct.rbs +1 -1
  57. data/core/symbol.rbs +4 -4
  58. data/core/thread.rbs +29 -92
  59. data/core/time.rbs +9 -35
  60. data/core/trace_point.rbs +4 -7
  61. data/core/unbound_method.rbs +6 -14
  62. data/docs/collection.md +2 -2
  63. data/docs/gem.md +1 -0
  64. data/docs/sigs.md +3 -3
  65. data/ext/rbs_extension/ast_translation.c +1077 -944
  66. data/ext/rbs_extension/ast_translation.h +0 -7
  67. data/ext/rbs_extension/class_constants.c +83 -71
  68. data/ext/rbs_extension/class_constants.h +7 -4
  69. data/ext/rbs_extension/extconf.rb +2 -24
  70. data/ext/rbs_extension/legacy_location.c +172 -173
  71. data/ext/rbs_extension/legacy_location.h +3 -8
  72. data/ext/rbs_extension/main.c +289 -239
  73. data/ext/rbs_extension/rbs_extension.h +0 -3
  74. data/ext/rbs_extension/rbs_string_bridging.h +0 -4
  75. data/include/rbs/ast.h +98 -37
  76. data/include/rbs/defines.h +12 -38
  77. data/include/rbs/lexer.h +114 -126
  78. data/include/rbs/location.h +14 -14
  79. data/include/rbs/parser.h +37 -21
  80. data/include/rbs/string.h +5 -3
  81. data/include/rbs/util/rbs_allocator.h +19 -40
  82. data/include/rbs/util/rbs_assert.h +1 -12
  83. data/include/rbs/util/rbs_constant_pool.h +3 -3
  84. data/include/rbs/util/rbs_encoding.h +1 -3
  85. data/include/rbs/util/rbs_unescape.h +1 -2
  86. data/lib/rbs/ast/ruby/annotations.rb +119 -0
  87. data/lib/rbs/ast/ruby/comment_block.rb +221 -0
  88. data/lib/rbs/ast/ruby/declarations.rb +86 -0
  89. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +24 -0
  90. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  91. data/lib/rbs/ast/ruby/members.rb +213 -0
  92. data/lib/rbs/buffer.rb +104 -24
  93. data/lib/rbs/cli/validate.rb +40 -35
  94. data/lib/rbs/cli.rb +5 -6
  95. data/lib/rbs/collection/config/lockfile_generator.rb +0 -1
  96. data/lib/rbs/collection.rb +0 -1
  97. data/lib/rbs/definition.rb +6 -1
  98. data/lib/rbs/definition_builder/ancestor_builder.rb +65 -62
  99. data/lib/rbs/definition_builder/method_builder.rb +45 -30
  100. data/lib/rbs/definition_builder.rb +44 -9
  101. data/lib/rbs/environment/class_entry.rb +69 -0
  102. data/lib/rbs/environment/module_entry.rb +66 -0
  103. data/lib/rbs/environment.rb +244 -218
  104. data/lib/rbs/environment_loader.rb +3 -3
  105. data/lib/rbs/errors.rb +5 -4
  106. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  107. data/lib/rbs/inline_parser.rb +206 -0
  108. data/lib/rbs/location_aux.rb +35 -3
  109. data/lib/rbs/parser_aux.rb +11 -6
  110. data/lib/rbs/prototype/runtime.rb +2 -2
  111. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  112. data/lib/rbs/resolver/type_name_resolver.rb +38 -124
  113. data/lib/rbs/source.rb +99 -0
  114. data/lib/rbs/subtractor.rb +4 -3
  115. data/lib/rbs/test/type_check.rb +0 -14
  116. data/lib/rbs/types.rb +1 -3
  117. data/lib/rbs/version.rb +1 -1
  118. data/lib/rbs.rb +13 -1
  119. data/lib/rdoc/discover.rb +1 -1
  120. data/lib/rdoc_plugin/parser.rb +1 -1
  121. data/rbs.gemspec +1 -0
  122. data/sig/ancestor_builder.rbs +1 -1
  123. data/sig/ast/ruby/annotations.rbs +110 -0
  124. data/sig/ast/ruby/comment_block.rbs +119 -0
  125. data/sig/ast/ruby/declarations.rbs +60 -0
  126. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  127. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  128. data/sig/ast/ruby/members.rbs +72 -0
  129. data/sig/buffer.rbs +63 -5
  130. data/sig/definition.rbs +1 -0
  131. data/sig/definition_builder.rbs +1 -1
  132. data/sig/environment/class_entry.rbs +50 -0
  133. data/sig/environment/module_entry.rbs +50 -0
  134. data/sig/environment.rbs +28 -133
  135. data/sig/errors.rbs +13 -6
  136. data/sig/inline_parser/comment_association.rbs +71 -0
  137. data/sig/inline_parser.rbs +87 -0
  138. data/sig/location.rbs +32 -7
  139. data/sig/manifest.yaml +1 -0
  140. data/sig/method_builder.rbs +7 -4
  141. data/sig/parser.rbs +16 -20
  142. data/sig/resolver/type_name_resolver.rbs +7 -38
  143. data/sig/source.rbs +48 -0
  144. data/sig/types.rbs +1 -4
  145. data/src/ast.c +290 -201
  146. data/src/lexer.c +2813 -2902
  147. data/src/lexer.re +4 -0
  148. data/src/lexstate.c +155 -169
  149. data/src/location.c +40 -40
  150. data/src/parser.c +2665 -2433
  151. data/src/string.c +48 -0
  152. data/src/util/rbs_allocator.c +77 -80
  153. data/src/util/rbs_assert.c +10 -10
  154. data/src/util/rbs_buffer.c +2 -2
  155. data/src/util/rbs_constant_pool.c +15 -13
  156. data/src/util/rbs_encoding.c +4062 -20097
  157. data/src/util/rbs_unescape.c +48 -85
  158. data/stdlib/bigdecimal/0/big_decimal.rbs +82 -100
  159. data/stdlib/bigdecimal-math/0/big_math.rbs +8 -169
  160. data/stdlib/cgi/0/core.rbs +396 -2
  161. data/stdlib/cgi/0/manifest.yaml +0 -1
  162. data/stdlib/coverage/0/coverage.rbs +1 -3
  163. data/stdlib/date/0/date.rbs +59 -67
  164. data/stdlib/date/0/date_time.rbs +1 -1
  165. data/stdlib/delegate/0/delegator.rbs +7 -10
  166. data/stdlib/erb/0/erb.rbs +347 -737
  167. data/stdlib/fileutils/0/fileutils.rbs +13 -18
  168. data/stdlib/forwardable/0/forwardable.rbs +0 -3
  169. data/stdlib/json/0/json.rbs +48 -68
  170. data/stdlib/net-http/0/net-http.rbs +0 -3
  171. data/stdlib/objspace/0/objspace.rbs +4 -9
  172. data/stdlib/open-uri/0/open-uri.rbs +0 -40
  173. data/stdlib/openssl/0/openssl.rbs +228 -331
  174. data/stdlib/optparse/0/optparse.rbs +3 -3
  175. data/{core → stdlib/pathname/0}/pathname.rbs +355 -255
  176. data/stdlib/psych/0/psych.rbs +3 -3
  177. data/stdlib/rdoc/0/rdoc.rbs +1 -1
  178. data/stdlib/resolv/0/resolv.rbs +68 -25
  179. data/stdlib/ripper/0/ripper.rbs +2 -5
  180. data/stdlib/singleton/0/singleton.rbs +0 -3
  181. data/stdlib/socket/0/socket.rbs +1 -13
  182. data/stdlib/socket/0/tcp_socket.rbs +2 -10
  183. data/stdlib/stringio/0/stringio.rbs +85 -1176
  184. data/stdlib/strscan/0/string_scanner.rbs +31 -31
  185. data/stdlib/tempfile/0/tempfile.rbs +3 -3
  186. data/stdlib/time/0/time.rbs +1 -1
  187. data/stdlib/timeout/0/timeout.rbs +7 -63
  188. data/stdlib/tsort/0/cyclic.rbs +0 -3
  189. data/stdlib/uri/0/common.rbs +2 -11
  190. data/stdlib/uri/0/file.rbs +1 -1
  191. data/stdlib/uri/0/generic.rbs +16 -17
  192. data/stdlib/uri/0/rfc2396_parser.rbs +7 -6
  193. data/stdlib/zlib/0/zstream.rbs +0 -1
  194. metadata +40 -12
  195. data/.clang-format +0 -74
  196. data/.clangd +0 -2
  197. data/.github/workflows/c-check.yml +0 -54
  198. data/core/ruby.rbs +0 -53
  199. data/docs/aliases.md +0 -79
  200. data/docs/encoding.md +0 -56
  201. data/ext/rbs_extension/compat.h +0 -10
  202. data/stdlib/cgi-escape/0/escape.rbs +0 -153
@@ -522,13 +522,11 @@ module FileUtils
522
522
  # symbolic links; other file types (FIFO streams, device files, etc.) are not
523
523
  # supported.
524
524
  #
525
- # Optional arguments:
525
+ # Keyword arguments:
526
526
  #
527
- # * `dereference_root` - if `src` is a symbolic link, follows the link
528
- # (`false` by default).
529
- # * `preserve` - preserves file times (`false` by default).
530
- # * `remove_destination` - removes `dest` before copying files (`false` by
531
- # default).
527
+ # * `dereference_root: true` - if `src` is a symbolic link, follows the link.
528
+ # * `preserve: true` - preserves file times.
529
+ # * `remove_destination: true` - removes `dest` before copying files.
532
530
  #
533
531
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
534
532
  #
@@ -549,13 +547,12 @@ module FileUtils
549
547
  # FileUtils.copy_file('src0.txt', 'dest0.txt')
550
548
  # File.file?('dest0.txt') # => true
551
549
  #
552
- # Optional arguments:
550
+ # Keyword arguments:
553
551
  #
554
- # * `dereference` - if `src` is a symbolic link, follows the link (`true` by
555
- # default).
556
- # * `preserve` - preserves file times (`false` by default).
557
- # * `remove_destination` - removes `dest` before copying files (`false` by
558
- # default).
552
+ # * `dereference: false` - if `src` is a symbolic link, does not follow the
553
+ # link.
554
+ # * `preserve: true` - preserves file times.
555
+ # * `remove_destination: true` - removes `dest` before copying files.
559
556
  #
560
557
  # Related: [methods for copying](rdoc-ref:FileUtils@Copying).
561
558
  #
@@ -966,15 +963,13 @@ module FileUtils
966
963
  # File.file?('dest1/dir1/t2.txt') # => true
967
964
  # File.file?('dest1/dir1/t3.txt') # => true
968
965
  #
969
- # Optional arguments:
966
+ # Keyword arguments:
970
967
  #
971
- # * `dereference_root` - dereferences `src` if it is a symbolic link (`false`
972
- # by default).
973
- # * `remove_destination` - removes `dest` before creating links (`false` by
974
- # default).
968
+ # * `dereference_root: true` - dereferences `src` if it is a symbolic link.
969
+ # * `remove_destination: true` - removes `dest` before creating links.
975
970
  #
976
971
  # Raises an exception if `dest` is the path to an existing file or directory and
977
- # optional argument `remove_destination` is not given.
972
+ # keyword argument `remove_destination: true` is not given.
978
973
  #
979
974
  # Related: FileUtils.ln (has different options).
980
975
  #
@@ -100,9 +100,6 @@ module Forwardable
100
100
  #
101
101
  VERSION: String
102
102
 
103
- # <!-- rdoc-file=lib/forwardable.rb -->
104
- # Version for backward compatibility
105
- #
106
103
  FORWARDABLE_VERSION: String
107
104
 
108
105
  # <!--
@@ -14,6 +14,9 @@ end
14
14
  class JSON::GeneratorError < JSON::JSONError
15
15
  end
16
16
 
17
+ class JSON::UnparserError < JSON::GeneratorError
18
+ end
19
+
17
20
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
18
21
  # This exception is raised if a parser error occurs.
19
22
  #
@@ -199,24 +202,6 @@ end
199
202
  #
200
203
  # ---
201
204
  #
202
- # Option `allow_duplicate_key` specifies whether duplicate keys in objects
203
- # should be ignored or cause an error to be raised:
204
- #
205
- # When not specified:
206
- # # The last value is used and a deprecation warning emitted.
207
- # JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
208
- # # warning: detected duplicate keys in JSON object.
209
- # # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
210
- #
211
- # When set to ``true``
212
- # # The last value is used.
213
- # JSON.parse('{"a": 1, "a":2}') => {"a" => 2}
214
- #
215
- # When set to ``false``, the future default:
216
- # JSON.parse('{"a": 1, "a":2}') => duplicate key at line 1 column 1 (JSON::ParserError)
217
- #
218
- # ---
219
- #
220
205
  # Option `allow_nan` (boolean) specifies whether to allow NaN, Infinity, and
221
206
  # MinusInfinity in `source`; defaults to `false`.
222
207
  #
@@ -233,22 +218,8 @@ end
233
218
  # ruby = JSON.parse(source, {allow_nan: true})
234
219
  # ruby # => [NaN, Infinity, -Infinity]
235
220
  #
236
- # ---
237
- #
238
- # Option `allow_trailing_comma` (boolean) specifies whether to allow trailing
239
- # commas in objects and arrays; defaults to `false`.
240
- #
241
- # With the default, `false`:
242
- # JSON.parse('[1,]') # unexpected character: ']' at line 1 column 4 (JSON::ParserError)
243
- #
244
- # When enabled:
245
- # JSON.parse('[1,]', allow_trailing_comma: true) # => [1]
246
- #
247
221
  # ###### Output Options
248
222
  #
249
- # Option `freeze` (boolean) specifies whether the returned objects will be
250
- # frozen; defaults to `false`.
251
- #
252
223
  # Option `symbolize_names` (boolean) specifies whether returned Hash keys should
253
224
  # be Symbols; defaults to `false` (use Strings).
254
225
  #
@@ -377,25 +348,6 @@ end
377
348
  #
378
349
  # ---
379
350
  #
380
- # Option `allow_duplicate_key` (boolean) specifies whether hashes with duplicate
381
- # keys should be allowed or produce an error. defaults to emit a deprecation
382
- # warning.
383
- #
384
- # With the default, (not set):
385
- # Warning[:deprecated] = true
386
- # JSON.generate({ foo: 1, "foo" => 2 })
387
- # # warning: detected duplicate key "foo" in {foo: 1, "foo" => 2}.
388
- # # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true`
389
- # # => '{"foo":1,"foo":2}'
390
- #
391
- # With `false`
392
- # JSON.generate({ foo: 1, "foo" => 2 }, allow_duplicate_key: false)
393
- # # detected duplicate key "foo" in {foo: 1, "foo" => 2} (JSON::GeneratorError)
394
- #
395
- # In version 3.0, `false` will become the default.
396
- #
397
- # ---
398
- #
399
351
  # Option `max_nesting` (Integer) specifies the maximum nesting depth in `obj`;
400
352
  # defaults to `100`.
401
353
  #
@@ -471,9 +423,6 @@ end
471
423
  #
472
424
  # ## JSON Additions
473
425
  #
474
- # Note that JSON Additions must only be used with trusted data, and is
475
- # deprecated.
476
- #
477
426
  # When you "round trip" a non-String object from Ruby to JSON and back, you have
478
427
  # a new String, instead of the object you began with:
479
428
  # ruby0 = Range.new(0, 2)
@@ -762,6 +711,8 @@ module JSON
762
711
  #
763
712
  def self.create_id=: (_ToS create_id) -> _ToS
764
713
 
714
+ def self.deep_const_get: (interned path) -> untyped
715
+
765
716
  # <!--
766
717
  # rdoc-file=ext/json/lib/json/common.rb
767
718
  # - JSON.dump(obj, io = nil, limit = nil)
@@ -803,7 +754,6 @@ module JSON
803
754
  # opts = JSON.dump_default_options
804
755
  # opts # => {:max_nesting=>false, :allow_nan=>true}
805
756
  #
806
- %a{deprecated}
807
757
  def self.dump_default_options: () -> options
808
758
 
809
759
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
@@ -811,7 +761,6 @@ module JSON
811
761
  # opts = JSON.dump_default_options
812
762
  # opts # => {:max_nesting=>false, :allow_nan=>true}
813
763
  #
814
- %a{deprecated}
815
764
  def self.dump_default_options=: (options) -> options
816
765
 
817
766
  # <!--
@@ -829,16 +778,19 @@ module JSON
829
778
  # # Raises SystemStackError (stack level too deep):
830
779
  # JSON.fast_generate(a)
831
780
  #
832
- %a{deprecated}
833
781
  def self?.fast_generate: (_ToJson obj, ?options opts) -> String
834
782
 
783
+ alias self.fast_unparse self.fast_generate
784
+
785
+ alias fast_unparse fast_generate
786
+
835
787
  # <!--
836
788
  # rdoc-file=ext/json/lib/json/common.rb
837
789
  # - JSON.generate(obj, opts = nil) -> new_string
838
790
  # -->
839
791
  # Returns a String containing the generated JSON data.
840
792
  #
841
- # See also JSON.pretty_generate.
793
+ # See also JSON.fast_generate, JSON.pretty_generate.
842
794
  #
843
795
  # Argument `obj` is the Ruby object to be converted to JSON.
844
796
  #
@@ -880,7 +832,14 @@ module JSON
880
832
 
881
833
  # <!--
882
834
  # rdoc-file=ext/json/lib/json/common.rb
883
- # - JSON.load(source, options = {}) -> object
835
+ # - iconv(to, from, string)
836
+ # -->
837
+ # Encodes string using String.encode.
838
+ #
839
+ def self.iconv: (encoding to, encoding from, String string) -> String
840
+
841
+ # <!--
842
+ # rdoc-file=ext/json/lib/json/common.rb
884
843
  # - JSON.load(source, proc = nil, options = {}) -> object
885
844
  # -->
886
845
  # Returns the Ruby objects created by parsing the given `source`.
@@ -993,7 +952,6 @@ module JSON
993
952
  # when Array
994
953
  # obj.map! {|v| deserialize_obj v }
995
954
  # end
996
- # obj
997
955
  # })
998
956
  # pp ruby
999
957
  #
@@ -1016,8 +974,7 @@ module JSON
1016
974
  # #<Admin:0x00000000064c41f8
1017
975
  # @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
1018
976
  #
1019
- def self?.load: (string | _ReadableIO | _Read source, ?options options) -> untyped
1020
- | [T] (string | _ReadableIO | _Read source, ^(?) -> T, ?options options) -> T
977
+ def self?.load: (string | _ReadableIO | _Read source, ?Proc proc, ?options options) -> untyped
1021
978
 
1022
979
  # <!--
1023
980
  # rdoc-file=ext/json/lib/json/common.rb
@@ -1046,7 +1003,6 @@ module JSON
1046
1003
  # opts = JSON.load_default_options
1047
1004
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1048
1005
  #
1049
- %a{deprecated}
1050
1006
  def self.load_default_options: () -> options
1051
1007
 
1052
1008
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
@@ -1054,7 +1010,6 @@ module JSON
1054
1010
  # opts = JSON.load_default_options
1055
1011
  # opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
1056
1012
  #
1057
- %a{deprecated}
1058
1013
  def self.load_default_options=: (options) -> options
1059
1014
 
1060
1015
  # <!--
@@ -1165,6 +1120,29 @@ module JSON
1165
1120
  #
1166
1121
  def self?.pretty_generate: (_ToJson obj, ?options opts) -> untyped
1167
1122
 
1123
+ alias self.pretty_unparse self.pretty_generate
1124
+
1125
+ alias pretty_unparse pretty_generate
1126
+
1127
+ # Recursively calls passed *Proc* if the parsed data structure is an *Array* or
1128
+ # *Hash*
1129
+ #
1130
+ def self?.recurse_proc: (untyped result) { (*untyped) -> void } -> void
1131
+
1132
+ # <!--
1133
+ # rdoc-file=ext/json/lib/json/common.rb
1134
+ # - restore(source, proc = nil, options = nil)
1135
+ # -->
1136
+ #
1137
+ alias self.restore self.load
1138
+
1139
+ # <!--
1140
+ # rdoc-file=ext/json/lib/json/common.rb
1141
+ # - restore(source, proc = nil, options = nil)
1142
+ # -->
1143
+ #
1144
+ alias restore load
1145
+
1168
1146
  # <!-- rdoc-file=ext/json/lib/json/common.rb -->
1169
1147
  # Sets or Returns the JSON generator state class that is used by JSON.
1170
1148
  #
@@ -1174,6 +1152,10 @@ module JSON
1174
1152
  # Sets or Returns the JSON generator state class that is used by JSON.
1175
1153
  #
1176
1154
  def self.state=: (state) -> state
1155
+
1156
+ alias self.unparse self.generate
1157
+
1158
+ alias unparse generate
1177
1159
  end
1178
1160
 
1179
1161
  JSON::FAST_STATE_PROTOTYPE: JSON::state
@@ -1211,7 +1193,6 @@ module Kernel
1211
1193
  # Outputs *objs* to STDOUT as JSON strings in the shortest form, that is in one
1212
1194
  # line.
1213
1195
  #
1214
- %a{deprecated}
1215
1196
  def j: (*_ToJson) -> nil
1216
1197
 
1217
1198
  # <!--
@@ -1221,12 +1202,11 @@ module Kernel
1221
1202
  # Outputs *objs* to STDOUT as JSON strings in a pretty format, with indentation
1222
1203
  # and over many lines.
1223
1204
  #
1224
- %a{deprecated}
1225
1205
  def jj: (*_ToJson) -> nil
1226
1206
 
1227
1207
  # <!--
1228
1208
  # rdoc-file=ext/json/lib/json/common.rb
1229
- # - JSON(object, opts = nil)
1209
+ # - JSON(object, *args)
1230
1210
  # -->
1231
1211
  # If *object* is string-like, parse the string and return the parsed result as a
1232
1212
  # Ruby data structure. Otherwise, generate a JSON text from the Ruby data
@@ -1874,7 +1854,7 @@ class Symbol
1874
1854
 
1875
1855
  # <!--
1876
1856
  # rdoc-file=ext/json/lib/json/add/symbol.rb
1877
- # - to_json(state = nil, *a)
1857
+ # - to_json(*a)
1878
1858
  # -->
1879
1859
  # Returns a JSON string representing `self`:
1880
1860
  #
@@ -4047,9 +4047,6 @@ module Net
4047
4047
  alias entity body
4048
4048
  end
4049
4049
 
4050
- # <!-- rdoc-file=lib/net/http/responses.rb -->
4051
- # Unknown HTTP response
4052
- #
4053
4050
  class HTTPUnknownResponse < HTTPResponse
4054
4051
  HAS_BODY: bool
4055
4052
 
@@ -332,11 +332,9 @@ module ObjectSpace
332
332
  # information as only a **HINT**. Especially, the size of `T_DATA` may not be
333
333
  # correct.
334
334
  #
335
- # This method is only expected to work with CRuby.
335
+ # This method is only expected to work with C Ruby.
336
336
  #
337
- # From Ruby 3.2 with Variable Width Allocation, it returns the actual slot size
338
- # used plus any additional memory allocated outside the slot (such as external
339
- # strings, arrays, or hash tables).
337
+ # From Ruby 2.2, memsize_of(obj) returns a memory size includes sizeof(RVALUE).
340
338
  #
341
339
  def self?.memsize_of: (untyped) -> Integer
342
340
 
@@ -411,7 +409,7 @@ module ObjectSpace
411
409
  # ObjectSpace.reachable_objects_from(1)
412
410
  # #=> nil # 1 is not markable (heap managed) object
413
411
  #
414
- def self?.reachable_objects_from: (untyped) -> (Array[untyped] | nil)
412
+ def self?.reachable_objects_from: (untyped) -> ([ untyped ] | nil)
415
413
 
416
414
  # <!--
417
415
  # rdoc-file=ext/objspace/objspace.c
@@ -463,11 +461,8 @@ module ObjectSpace
463
461
 
464
462
  # <!--
465
463
  # rdoc-file=ext/objspace/object_tracing.c
466
- # - trace_object_allocations_debug_start
464
+ # - trace_object_allocations_debug_start()
467
465
  # -->
468
- # Starts tracing object allocations for GC debugging. If you encounter the BUG
469
- # "... is T_NONE" (and so on) on your application, please try this method at the
470
- # beginning of your app.
471
466
  #
472
467
  def self?.trace_object_allocations_debug_start: () -> void
473
468
 
@@ -83,46 +83,6 @@ end
83
83
  # : Tanaka Akira <akr@m17n.org>
84
84
  #
85
85
  module OpenURI
86
- # <!-- rdoc-file=lib/open-uri.rb -->
87
- # Raised on HTTP session failure
88
- #
89
- class HTTPError < StandardError
90
- # <!--
91
- # rdoc-file=lib/open-uri.rb
92
- # - new(message, io)
93
- # -->
94
- #
95
- def initialize: (String message, (StringIO & OpenURI::Meta) io) -> void
96
-
97
- # <!-- rdoc-file=lib/open-uri.rb -->
98
- # StringIO having the received data
99
- #
100
- attr_reader io: StringIO & OpenURI::Meta
101
- end
102
-
103
- # <!-- rdoc-file=lib/open-uri.rb -->
104
- # Raised on redirection, only occurs when `redirect` option for HTTP is `false`.
105
- #
106
- class HTTPRedirect < HTTPError
107
- # <!--
108
- # rdoc-file=lib/open-uri.rb
109
- # - new(message, io, uri)
110
- # -->
111
- #
112
- def initialize: (String message, (StringIO & OpenURI::Meta) io, URI uri) -> void
113
-
114
- # <!-- rdoc-file=lib/open-uri.rb -->
115
- # URI to redirect
116
- #
117
- attr_reader uri: URI
118
- end
119
-
120
- # <!-- rdoc-file=lib/open-uri.rb -->
121
- # Raised on too many redirection,
122
- #
123
- class TooManyRedirects < HTTPError
124
- end
125
-
126
86
  # <!-- rdoc-file=lib/open-uri.rb -->
127
87
  # Mixin for holding meta-information.
128
88
  #