rbs 3.9.4 → 4.1.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 (348) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +75 -0
  3. data/.clangd +2 -0
  4. data/.dockerignore +37 -0
  5. data/.github/dependabot.yml +16 -14
  6. data/.github/workflows/bundle-update.yml +63 -0
  7. data/.github/workflows/c-check.yml +66 -0
  8. data/.github/workflows/comments.yml +5 -3
  9. data/.github/workflows/dependabot.yml +2 -2
  10. data/.github/workflows/jruby.yml +79 -0
  11. data/.github/workflows/release-gems.yml +164 -0
  12. data/.github/workflows/ruby.yml +84 -30
  13. data/.github/workflows/rust.yml +186 -0
  14. data/.github/workflows/truffleruby.yml +54 -0
  15. data/.github/workflows/typecheck.yml +5 -2
  16. data/.github/workflows/wasm.yml +55 -0
  17. data/.github/workflows/windows.yml +9 -3
  18. data/.gitignore +16 -0
  19. data/.rubocop.yml +2 -2
  20. data/CHANGELOG.md +430 -0
  21. data/Dockerfile.jruby +53 -0
  22. data/README.md +41 -4
  23. data/Rakefile +777 -60
  24. data/Steepfile +11 -0
  25. data/config.yml +660 -62
  26. data/core/array.rbs +541 -398
  27. data/core/basic_object.rbs +9 -8
  28. data/core/binding.rbs +0 -2
  29. data/core/builtin.rbs +9 -8
  30. data/core/class.rbs +11 -8
  31. data/core/comparable.rbs +55 -34
  32. data/core/complex.rbs +104 -78
  33. data/core/dir.rbs +61 -49
  34. data/core/encoding.rbs +12 -15
  35. data/core/enumerable.rbs +297 -196
  36. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  37. data/core/enumerator/product.rbs +5 -5
  38. data/core/enumerator.rbs +91 -28
  39. data/core/errno.rbs +11 -2
  40. data/core/errors.rbs +58 -29
  41. data/core/exception.rbs +13 -13
  42. data/core/fiber.rbs +74 -54
  43. data/core/file.rbs +260 -1151
  44. data/core/file_constants.rbs +463 -0
  45. data/core/file_stat.rbs +534 -0
  46. data/core/file_test.rbs +3 -3
  47. data/core/float.rbs +257 -116
  48. data/core/gc.rbs +425 -281
  49. data/core/hash.rbs +1151 -829
  50. data/core/integer.rbs +156 -195
  51. data/core/io/buffer.rbs +53 -42
  52. data/core/io/wait.rbs +13 -35
  53. data/core/io.rbs +220 -154
  54. data/core/kernel.rbs +239 -163
  55. data/core/marshal.rbs +4 -4
  56. data/core/match_data.rbs +16 -14
  57. data/core/math.rbs +107 -66
  58. data/core/method.rbs +69 -33
  59. data/core/module.rbs +302 -150
  60. data/core/nil_class.rbs +7 -6
  61. data/core/numeric.rbs +77 -63
  62. data/core/object.rbs +9 -11
  63. data/core/object_space/weak_key_map.rbs +7 -7
  64. data/core/object_space.rbs +30 -23
  65. data/core/pathname.rbs +1312 -0
  66. data/core/proc.rbs +95 -58
  67. data/core/process.rbs +222 -202
  68. data/core/ractor.rbs +364 -518
  69. data/core/random.rbs +21 -3
  70. data/core/range.rbs +181 -79
  71. data/core/rational.rbs +60 -89
  72. data/core/rbs/ops.rbs +154 -0
  73. data/core/rbs/unnamed/argf.rbs +63 -56
  74. data/core/rbs/unnamed/env_class.rbs +19 -14
  75. data/core/rbs/unnamed/main_class.rbs +123 -0
  76. data/core/rbs/unnamed/random.rbs +11 -118
  77. data/core/regexp.rbs +258 -214
  78. data/core/ruby.rbs +53 -0
  79. data/core/ruby_vm.rbs +78 -34
  80. data/core/rubygems/config_file.rbs +5 -5
  81. data/core/rubygems/errors.rbs +6 -70
  82. data/core/rubygems/requirement.rbs +5 -15
  83. data/core/rubygems/rubygems.rbs +18 -81
  84. data/core/rubygems/specification.rbs +8 -0
  85. data/core/rubygems/version.rbs +2 -163
  86. data/core/set.rbs +493 -363
  87. data/core/signal.rbs +26 -16
  88. data/core/string.rbs +3234 -1285
  89. data/core/struct.rbs +43 -42
  90. data/core/symbol.rbs +41 -34
  91. data/core/thread.rbs +139 -83
  92. data/core/time.rbs +81 -50
  93. data/core/trace_point.rbs +41 -35
  94. data/core/true_class.rbs +2 -2
  95. data/core/unbound_method.rbs +24 -16
  96. data/core/warning.rbs +7 -7
  97. data/docs/CONTRIBUTING.md +2 -1
  98. data/docs/aliases.md +79 -0
  99. data/docs/collection.md +3 -3
  100. data/docs/config.md +171 -0
  101. data/docs/encoding.md +56 -0
  102. data/docs/gem.md +0 -1
  103. data/docs/inline.md +634 -0
  104. data/docs/rbs_by_example.md +20 -20
  105. data/docs/release.md +151 -0
  106. data/docs/rust.md +96 -0
  107. data/docs/sigs.md +3 -3
  108. data/docs/syntax.md +48 -18
  109. data/docs/type_fingerprint.md +21 -0
  110. data/docs/wasm_serialization.md +80 -0
  111. data/exe/rbs +1 -1
  112. data/ext/rbs_extension/ast_translation.c +1855 -0
  113. data/ext/rbs_extension/ast_translation.h +41 -0
  114. data/ext/rbs_extension/class_constants.c +187 -0
  115. data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +23 -1
  116. data/ext/rbs_extension/compat.h +10 -0
  117. data/ext/rbs_extension/extconf.rb +26 -1
  118. data/ext/rbs_extension/legacy_location.c +299 -0
  119. data/ext/rbs_extension/legacy_location.h +82 -0
  120. data/ext/rbs_extension/main.c +603 -23
  121. data/ext/rbs_extension/rbs_extension.h +6 -21
  122. data/ext/rbs_extension/rbs_string_bridging.c +9 -0
  123. data/ext/rbs_extension/rbs_string_bridging.h +24 -0
  124. data/include/rbs/ast.h +1047 -0
  125. data/include/rbs/defines.h +99 -0
  126. data/include/rbs/lexer.h +207 -0
  127. data/include/rbs/location.h +40 -0
  128. data/include/rbs/parser.h +153 -0
  129. data/include/rbs/serialize.h +39 -0
  130. data/include/rbs/string.h +47 -0
  131. data/include/rbs/util/rbs_allocator.h +59 -0
  132. data/include/rbs/util/rbs_assert.h +20 -0
  133. data/include/rbs/util/rbs_buffer.h +83 -0
  134. data/include/rbs/util/rbs_constant_pool.h +6 -70
  135. data/include/rbs/util/rbs_encoding.h +282 -0
  136. data/include/rbs/util/rbs_unescape.h +24 -0
  137. data/include/rbs.h +9 -2
  138. data/lib/rbs/annotate/formatter.rb +3 -13
  139. data/lib/rbs/annotate/rdoc_annotator.rb +30 -32
  140. data/lib/rbs/annotate/rdoc_source.rb +1 -1
  141. data/lib/rbs/ast/annotation.rb +1 -1
  142. data/lib/rbs/ast/comment.rb +1 -1
  143. data/lib/rbs/ast/declarations.rb +10 -10
  144. data/lib/rbs/ast/members.rb +14 -14
  145. data/lib/rbs/ast/ruby/annotations.rb +451 -0
  146. data/lib/rbs/ast/ruby/comment_block.rb +247 -0
  147. data/lib/rbs/ast/ruby/declarations.rb +291 -0
  148. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
  149. data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
  150. data/lib/rbs/ast/ruby/members.rb +762 -0
  151. data/lib/rbs/ast/type_param.rb +24 -4
  152. data/lib/rbs/buffer.rb +142 -20
  153. data/lib/rbs/cli/diff.rb +16 -15
  154. data/lib/rbs/cli/validate.rb +63 -126
  155. data/lib/rbs/cli.rb +59 -29
  156. data/lib/rbs/collection/config/lockfile_generator.rb +28 -3
  157. data/lib/rbs/collection/sources/git.rb +7 -0
  158. data/lib/rbs/definition.rb +6 -1
  159. data/lib/rbs/definition_builder/ancestor_builder.rb +121 -65
  160. data/lib/rbs/definition_builder/method_builder.rb +74 -33
  161. data/lib/rbs/definition_builder.rb +177 -20
  162. data/lib/rbs/diff.rb +7 -1
  163. data/lib/rbs/environment/class_entry.rb +69 -0
  164. data/lib/rbs/environment/module_entry.rb +66 -0
  165. data/lib/rbs/environment.rb +410 -215
  166. data/lib/rbs/environment_loader.rb +2 -8
  167. data/lib/rbs/errors.rb +31 -21
  168. data/lib/rbs/inline_parser/comment_association.rb +117 -0
  169. data/lib/rbs/inline_parser.rb +568 -0
  170. data/lib/rbs/location_aux.rb +36 -4
  171. data/lib/rbs/locator.rb +5 -1
  172. data/lib/rbs/method_type.rb +5 -3
  173. data/lib/rbs/namespace.rb +47 -18
  174. data/lib/rbs/parser_aux.rb +37 -7
  175. data/lib/rbs/prototype/helpers.rb +57 -0
  176. data/lib/rbs/prototype/rb.rb +3 -28
  177. data/lib/rbs/prototype/rbi.rb +196 -45
  178. data/lib/rbs/prototype/runtime.rb +12 -2
  179. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  180. data/lib/rbs/resolver/type_name_resolver.rb +120 -44
  181. data/lib/rbs/rewriter.rb +70 -0
  182. data/lib/rbs/source.rb +99 -0
  183. data/lib/rbs/subtractor.rb +7 -4
  184. data/lib/rbs/test/type_check.rb +25 -3
  185. data/lib/rbs/type_name.rb +34 -21
  186. data/lib/rbs/types.rb +91 -79
  187. data/lib/rbs/unit_test/convertibles.rb +1 -0
  188. data/lib/rbs/unit_test/type_assertions.rb +44 -8
  189. data/lib/rbs/validator.rb +2 -2
  190. data/lib/rbs/version.rb +1 -1
  191. data/lib/rbs/wasm/deserializer.rb +213 -0
  192. data/lib/rbs/wasm/location.rb +61 -0
  193. data/lib/rbs/wasm/parser.rb +137 -0
  194. data/lib/rbs/wasm/runtime.rb +196 -0
  195. data/lib/rbs/wasm/serialization_schema.rb +110 -0
  196. data/lib/rbs.rb +25 -2
  197. data/lib/rbs_jars.rb +39 -0
  198. data/lib/rdoc/discover.rb +1 -1
  199. data/lib/rdoc_plugin/parser.rb +8 -3
  200. data/rbs.gemspec +37 -5
  201. data/schema/typeParam.json +17 -1
  202. data/sig/ancestor_builder.rbs +1 -1
  203. data/sig/annotate/formatter.rbs +2 -2
  204. data/sig/annotate/rdoc_annotater.rbs +13 -10
  205. data/sig/ast/ruby/annotations.rbs +470 -0
  206. data/sig/ast/ruby/comment_block.rbs +127 -0
  207. data/sig/ast/ruby/declarations.rbs +158 -0
  208. data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
  209. data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
  210. data/sig/ast/ruby/members.rbs +198 -0
  211. data/sig/buffer.rbs +81 -5
  212. data/sig/cli/diff.rbs +5 -11
  213. data/sig/cli/validate.rbs +12 -8
  214. data/sig/cli.rbs +18 -18
  215. data/sig/collection/config/lockfile_generator.rbs +2 -0
  216. data/sig/definition.rbs +6 -0
  217. data/sig/definition_builder.rbs +3 -1
  218. data/sig/environment/class_entry.rbs +50 -0
  219. data/sig/environment/module_entry.rbs +50 -0
  220. data/sig/environment.rbs +94 -87
  221. data/sig/errors.rbs +26 -20
  222. data/sig/inline_parser/comment_association.rbs +71 -0
  223. data/sig/inline_parser.rbs +126 -0
  224. data/sig/location.rbs +32 -7
  225. data/sig/locator.rbs +0 -2
  226. data/sig/manifest.yaml +0 -2
  227. data/sig/method_builder.rbs +9 -4
  228. data/sig/namespace.rbs +20 -5
  229. data/sig/parser.rbs +77 -13
  230. data/sig/prototype/helpers.rbs +2 -0
  231. data/sig/prototype/rbi.rbs +33 -4
  232. data/sig/resolver/type_name_resolver.rbs +36 -10
  233. data/sig/rewriter.rbs +45 -0
  234. data/sig/source.rbs +48 -0
  235. data/sig/type_param.rbs +13 -8
  236. data/sig/typename.rbs +15 -5
  237. data/sig/types.rbs +10 -8
  238. data/sig/unit_test/spy.rbs +0 -8
  239. data/sig/unit_test/type_assertions.rbs +15 -0
  240. data/sig/wasm/deserializer.rbs +66 -0
  241. data/sig/wasm/serialization_schema.rbs +13 -0
  242. data/src/ast.c +1628 -0
  243. data/src/lexer.c +3221 -0
  244. data/src/lexer.re +155 -0
  245. data/src/lexstate.c +221 -0
  246. data/src/location.c +31 -0
  247. data/src/parser.c +4258 -0
  248. data/src/serialize.c +958 -0
  249. data/src/string.c +41 -0
  250. data/src/util/rbs_allocator.c +171 -0
  251. data/src/util/rbs_assert.c +19 -0
  252. data/src/util/rbs_buffer.c +54 -0
  253. data/src/util/rbs_constant_pool.c +18 -92
  254. data/src/util/rbs_encoding.c +21308 -0
  255. data/src/util/rbs_unescape.c +167 -0
  256. data/stdlib/abbrev/0/array.rbs +1 -1
  257. data/stdlib/bigdecimal/0/big_decimal.rbs +116 -98
  258. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  259. data/stdlib/cgi/0/core.rbs +9 -393
  260. data/stdlib/cgi/0/manifest.yaml +1 -0
  261. data/stdlib/cgi-escape/0/escape.rbs +171 -0
  262. data/stdlib/coverage/0/coverage.rbs +7 -4
  263. data/stdlib/csv/0/csv.rbs +5 -5
  264. data/stdlib/date/0/date.rbs +92 -79
  265. data/stdlib/date/0/date_time.rbs +25 -24
  266. data/stdlib/delegate/0/delegator.rbs +11 -7
  267. data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
  268. data/stdlib/digest/0/digest.rbs +117 -1
  269. data/stdlib/erb/0/erb.rbs +748 -347
  270. data/stdlib/etc/0/etc.rbs +73 -54
  271. data/stdlib/fileutils/0/fileutils.rbs +179 -160
  272. data/stdlib/forwardable/0/forwardable.rbs +13 -10
  273. data/stdlib/io-console/0/io-console.rbs +2 -2
  274. data/stdlib/ipaddr/0/ipaddr.rbs +0 -5
  275. data/stdlib/json/0/json.rbs +232 -185
  276. data/stdlib/monitor/0/monitor.rbs +5 -5
  277. data/stdlib/net-http/0/net-http.rbs +162 -134
  278. data/stdlib/objspace/0/objspace.rbs +17 -34
  279. data/stdlib/open-uri/0/open-uri.rbs +48 -8
  280. data/stdlib/open3/0/open3.rbs +469 -10
  281. data/stdlib/openssl/0/openssl.rbs +521 -397
  282. data/stdlib/optparse/0/optparse.rbs +26 -17
  283. data/stdlib/pathname/0/pathname.rbs +11 -1381
  284. data/stdlib/pp/0/pp.rbs +9 -8
  285. data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
  286. data/stdlib/pstore/0/pstore.rbs +35 -30
  287. data/stdlib/psych/0/psych.rbs +65 -12
  288. data/stdlib/psych/0/store.rbs +2 -4
  289. data/stdlib/pty/0/pty.rbs +9 -6
  290. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  291. data/stdlib/rdoc/0/code_object.rbs +4 -3
  292. data/stdlib/rdoc/0/comment.rbs +2 -0
  293. data/stdlib/rdoc/0/options.rbs +76 -0
  294. data/stdlib/rdoc/0/parser.rbs +1 -1
  295. data/stdlib/rdoc/0/rdoc.rbs +7 -5
  296. data/stdlib/rdoc/0/store.rbs +2 -2
  297. data/stdlib/resolv/0/resolv.rbs +26 -69
  298. data/stdlib/ripper/0/ripper.rbs +25 -19
  299. data/stdlib/securerandom/0/manifest.yaml +2 -0
  300. data/stdlib/securerandom/0/securerandom.rbs +7 -20
  301. data/stdlib/shellwords/0/shellwords.rbs +3 -3
  302. data/stdlib/singleton/0/singleton.rbs +3 -0
  303. data/stdlib/socket/0/addrinfo.rbs +9 -9
  304. data/stdlib/socket/0/basic_socket.rbs +3 -3
  305. data/stdlib/socket/0/ip_socket.rbs +10 -8
  306. data/stdlib/socket/0/socket.rbs +23 -10
  307. data/stdlib/socket/0/tcp_server.rbs +1 -1
  308. data/stdlib/socket/0/tcp_socket.rbs +11 -3
  309. data/stdlib/socket/0/udp_socket.rbs +1 -1
  310. data/stdlib/socket/0/unix_server.rbs +1 -1
  311. data/stdlib/stringio/0/stringio.rbs +1209 -95
  312. data/stdlib/strscan/0/string_scanner.rbs +101 -80
  313. data/stdlib/tempfile/0/manifest.yaml +3 -0
  314. data/stdlib/tempfile/0/tempfile.rbs +25 -21
  315. data/stdlib/time/0/time.rbs +8 -6
  316. data/stdlib/timeout/0/timeout.rbs +58 -7
  317. data/stdlib/tsort/0/cyclic.rbs +4 -1
  318. data/stdlib/tsort/0/interfaces.rbs +8 -8
  319. data/stdlib/tsort/0/tsort.rbs +16 -15
  320. data/stdlib/uri/0/common.rbs +42 -20
  321. data/stdlib/uri/0/file.rbs +3 -3
  322. data/stdlib/uri/0/generic.rbs +21 -18
  323. data/stdlib/uri/0/http.rbs +2 -2
  324. data/stdlib/uri/0/ldap.rbs +2 -2
  325. data/stdlib/uri/0/mailto.rbs +3 -3
  326. data/stdlib/uri/0/rfc2396_parser.rbs +12 -12
  327. data/stdlib/zlib/0/deflate.rbs +4 -3
  328. data/stdlib/zlib/0/gzip_reader.rbs +8 -8
  329. data/stdlib/zlib/0/gzip_writer.rbs +14 -12
  330. data/stdlib/zlib/0/inflate.rbs +1 -1
  331. data/stdlib/zlib/0/need_dict.rbs +1 -1
  332. data/wasm/README.md +60 -0
  333. data/wasm/rbs_wasm.c +423 -0
  334. metadata +131 -19
  335. data/ext/rbs_extension/lexer.c +0 -2728
  336. data/ext/rbs_extension/lexer.h +0 -179
  337. data/ext/rbs_extension/lexer.re +0 -147
  338. data/ext/rbs_extension/lexstate.c +0 -175
  339. data/ext/rbs_extension/location.c +0 -325
  340. data/ext/rbs_extension/location.h +0 -85
  341. data/ext/rbs_extension/parser.c +0 -2982
  342. data/ext/rbs_extension/parser.h +0 -18
  343. data/ext/rbs_extension/parserstate.c +0 -411
  344. data/ext/rbs_extension/parserstate.h +0 -163
  345. data/ext/rbs_extension/unescape.c +0 -32
  346. data/include/rbs/ruby_objs.h +0 -72
  347. data/src/constants.c +0 -153
  348. data/src/ruby_objs.c +0 -799
data/CHANGELOG.md CHANGED
@@ -1,5 +1,435 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 4.1.1 (2026-07-30)
4
+
5
+ ### Library changes
6
+
7
+ * Include the trailing `?` in a keyword key's symbol location ([#3043](https://github.com/ruby/rbs/pull/3043))
8
+ * Mark `type_name` as optional on the alias annotations ([#3039](https://github.com/ruby/rbs/pull/3039))
9
+
10
+ ### Miscellaneous
11
+
12
+ * Fix template drift for ext/rbs_extension/ast_translation.c ([#3038](https://github.com/ruby/rbs/pull/3038))
13
+
14
+ ## 4.1.0 (2026-07-27)
15
+
16
+ RBS 4.1 ships with JRuby support. The RBS parser is written in plain C without depending on the Ruby C API, so it is compiled to WebAssembly and runs on a Wasm runtime, with the parsed AST serialized in a binary format and decoded into RBS objects. The full test suite runs on JRuby in CI.
17
+
18
+ The inline RBS syntax gets three new features: singleton method definitions (`def self.`), the `module-self` constraint, and instance variable annotations in `module` declarations. Note that RBS inline is still experimental and may change in future releases.
19
+
20
+ This release also introduces `RBS::Rewriter`, an API to edit RBS source text while preserving the surrounding content, which `rbs annotate` is now built on. Parsing performance is improved by interning type names in a shared trie and reducing allocations per node.
21
+
22
+ `RBS::Prototype::Runtime`, the RDoc plugin parser, and the top-level `float` type alias are deprecated in this release.
23
+
24
+ ### Signature updates
25
+
26
+ **Updated classes/modules/methods:** `ARGF`, `Array`, `CSV`, `Class`, `Delegator`, `Digest`, `ERB`, `Enumerable`, `Enumerator`, `Enumerator::Product`, `Etc`, `File`, `File::Constants`, `File::Stat`, `FileUtils`, `Float`, `Gem`, `Hash`, `IO`, `IPAddr`, `Integer`, `JSON`, `Kernel`, `MatchData`, `Module`, `Monitor`, `Numeric`, `ObjectSpace::WeakKeyMap`, `OpenSSL`, `Pathname`, `RBS::Ops`, `Ractor`, `Range`, `Resolv`, `RubyVM::InstructionSequence`, `Set`, `Shellwords`, `String`, `StringIO`, `StringScanner`, `Struct`, `Tempfile`, `Thread`, `Timeout`, `TSort`, `URI::Generic`, `Zlib::GzipReader`, `Zlib::ZStream`
27
+
28
+ * Remove stale Float constants and add a constant drift test ([#2994](https://github.com/ruby/rbs/pull/2994))
29
+ * Update RDoc comments with Ruby 4.0.6 ([#3035](https://github.com/ruby/rbs/pull/3035))
30
+ * Add a dependency on tempfile. ([#3025](https://github.com/ruby/rbs/pull/3025))
31
+ * Support `%a{implicitly-returns-nil}` on `MatchData#[]` ([#2990](https://github.com/ruby/rbs/pull/2990))
32
+ * Update `Array` ([#2987](https://github.com/ruby/rbs/pull/2987))
33
+ * Allow nil output buffers for reader methods ([#3002](https://github.com/ruby/rbs/pull/3002))
34
+ * Add stdlib signature tests for #2967 ([#2989](https://github.com/ruby/rbs/pull/2989))
35
+ * Update `Integer`, phase 1 ([#2995](https://github.com/ruby/rbs/pull/2995))
36
+ * Add RBS::Ops ([#2934](https://github.com/ruby/rbs/pull/2934))
37
+ * Update Module ([#2933](https://github.com/ruby/rbs/pull/2933))
38
+ * Correct core/stdlib signatures to match Ruby 4.0 ([#2967](https://github.com/ruby/rbs/pull/2967))
39
+ * Revert Digest::Class method changes ([#2980](https://github.com/ruby/rbs/pull/2980))
40
+ * Add stdlib tests for updated StringScanner signatures ([#2968](https://github.com/ruby/rbs/pull/2968))
41
+ * Update `StringScanner` signatures to match strscan 3.1.6 ([#2959](https://github.com/ruby/rbs/pull/2959))
42
+ * Remove StringScanner methods absent from the latest Ruby release ([#2961](https://github.com/ruby/rbs/pull/2961))
43
+ * Fix `Resolv#initialize` signature: array of resolvers + `use_ipv6:` ([#2960](https://github.com/ruby/rbs/pull/2960))
44
+ * [Hash] Update Hash's signatures and tests to be correct ([#2694](https://github.com/ruby/rbs/pull/2694))
45
+ * update rbs signatures to be more consistent with generics ([#2867](https://github.com/ruby/rbs/pull/2867))
46
+ * Use top-level `path` in fileutils.rbs to suppress deprecation warning ([#2949](https://github.com/ruby/rbs/pull/2949))
47
+ * Update File::Constants and File::Stat ([#2942](https://github.com/ruby/rbs/pull/2942))
48
+ * Add signature for `RubyVM::InstructionSequence.of` ([#2916](https://github.com/ruby/rbs/pull/2916))
49
+ * fix OpenSSL#session_new_cb signature ([#2924](https://github.com/ruby/rbs/pull/2924))
50
+ * [Class] update class.rbs ([#2898](https://github.com/ruby/rbs/pull/2898))
51
+ * Deprecate top-level float ([#2695](https://github.com/ruby/rbs/pull/2695))
52
+ * [Kernel] Updated querying methods ([#2685](https://github.com/ruby/rbs/pull/2685))
53
+
54
+ ### Library changes
55
+
56
+ * Convert character offset to byte offset in parse_inline_*_annotation ([#2945](https://github.com/ruby/rbs/pull/2945))
57
+ * Guard against underflow when sysconf(_SC_PAGESIZE) returns 0 ([#3031](https://github.com/ruby/rbs/pull/3031))
58
+ * Report invalid UTF-8 byte in a comment as a parsing error ([#2983](https://github.com/ruby/rbs/pull/2983))
59
+ * Fetch Chicory/ASM jars from Maven instead of bundling in gem ([#3019](https://github.com/ruby/rbs/pull/3019))
60
+ * Add write barrier protection to RBS Location objects ([#3022](https://github.com/ruby/rbs/pull/3022))
61
+ * Rename parameter in rbs_intern_type_name for clarity ([#3023](https://github.com/ruby/rbs/pull/3023))
62
+ * Deprecate RDoc plugin parser ([#3016](https://github.com/ruby/rbs/pull/3016))
63
+ * Run the test suite on JRuby (JRuby support, step 4) ([#3008](https://github.com/ruby/rbs/pull/3008))
64
+ * Run the RBS parser on JRuby via WebAssembly (JRuby support, step 3) ([#3000](https://github.com/ruby/rbs/pull/3000))
65
+ * Add binary serialization of the parsed AST (JRuby support, step 2) ([#2999](https://github.com/ruby/rbs/pull/2999))
66
+ * Build the RBS parser as a WebAssembly module (JRuby support, step 1) ([#2998](https://github.com/ruby/rbs/pull/2998))
67
+ * Reject reversed position ranges in parser/lexer entrypoints ([#2974](https://github.com/ruby/rbs/pull/2974))
68
+ * Fix lexer infinite loop / abort on invalid UTF-8 byte ([#2973](https://github.com/ruby/rbs/pull/2973))
69
+ * Flyweight TypeName / Namespace cached in a shared trie ([#2957](https://github.com/ruby/rbs/pull/2957))
70
+ * Reduce Hash allocation per `Node` creation ([#2946](https://github.com/ruby/rbs/pull/2946))
71
+ * Tidy `ast_translation.c` ([#2947](https://github.com/ruby/rbs/pull/2947))
72
+ * Auto-generate rbs_ast_ruby_annotations_t union from config.yml ([#2939](https://github.com/ruby/rbs/pull/2939))
73
+ * Speed up RBS::InlineParser on large sources with non-ASCII characters ([#2950](https://github.com/ruby/rbs/pull/2950))
74
+ * Support `def self.method_name` singleton method in inline parser ([#2935](https://github.com/ruby/rbs/pull/2935))
75
+ * This is not prism ([#2951](https://github.com/ruby/rbs/pull/2951))
76
+ * Add RBS::Rewriter and use it in rbs annotate ([#2927](https://github.com/ruby/rbs/pull/2927))
77
+ * Add nullability annotations to AST pointer types ([#2922](https://github.com/ruby/rbs/pull/2922))
78
+ * Support `module-self` inline annotation ([#2921](https://github.com/ruby/rbs/pull/2921))
79
+ * Inline instance variable annotation in module declaration ([#2919](https://github.com/ruby/rbs/pull/2919))
80
+
81
+ #### rbs prototype
82
+
83
+ * Fix nested declarations in rbs prototype rbi ([#3029](https://github.com/ruby/rbs/pull/3029))
84
+ * Deprecate prototype runtime ([#2956](https://github.com/ruby/rbs/pull/2956))
85
+
86
+ #### rbs collection
87
+
88
+ * Clean up partial clone before falling back to full clone ([#2978](https://github.com/ruby/rbs/pull/2978))
89
+ * Suppress spurious warning for non-gem stdlib libraries ([#2929](https://github.com/ruby/rbs/pull/2929))
90
+
91
+ ### Miscellaneous
92
+
93
+ * Fix Lint/DuplicateMethods in StringIO_test.rb ([#3010](https://github.com/ruby/rbs/pull/3010))
94
+ * Compressed files must be opened in binary mode ([#2981](https://github.com/ruby/rbs/pull/2981))
95
+ * Fix flaky DirSingletonTest GC failures in test_fchdir and test_for_fd ([#3004](https://github.com/ruby/rbs/pull/3004))
96
+ * Add TruffleRuby CI job ([#2996](https://github.com/ruby/rbs/pull/2996))
97
+ * Update the target Ruby version notes to the latest release ([#2962](https://github.com/ruby/rbs/pull/2962))
98
+ * Update docs/inline.md to match current inline parser behavior ([#2953](https://github.com/ruby/rbs/pull/2953))
99
+ * ci: skip Gemfile.lock BUNDLED WITH on ruby-head ([#2952](https://github.com/ruby/rbs/pull/2952))
100
+ * Remove `logger` from sig dependencies ([#2904](https://github.com/ruby/rbs/pull/2904))
101
+
102
+ ## 4.0.2 (2026-03-25)
103
+
104
+ ### Library changes
105
+
106
+ #### rbs collection
107
+
108
+ * Fix: pathname not written to lockfile. ([#2889](https://github.com/ruby/rbs/pull/2889))
109
+
110
+ ### Miscellaneous
111
+
112
+ * Fix test failure on Windows in `ruby/ruby` ([#2900](https://github.com/ruby/rbs/pull/2900))
113
+ * Fix test for Ruby 4.1 ([#2899](https://github.com/ruby/rbs/pull/2899))
114
+
115
+ ## 4.0.1 (2026-03-23)
116
+
117
+ This is a minor release to fix Ruby CI failure, which was caused by symlinks included in the `rust` directory.
118
+
119
+ ### Library changes
120
+
121
+ * Fix `() -> (void)` being rejected as SyntaxError ([#2884](https://github.com/ruby/rbs/pull/2884))
122
+
123
+ ### Miscellaneous
124
+
125
+ * Drop crates ([#2887](https://github.com/ruby/rbs/pull/2887))
126
+ * Add newline at eof ([#2885](https://github.com/ruby/rbs/pull/2885))
127
+
128
+ ## 4.0.0 (2026-03-16)
129
+
130
+ RBS 4.0 ships with experimental RBS inline syntax support, allowing you to write type annotations directly in Ruby source files. See [docs/inline.md](docs/inline.md) for the syntax details.
131
+
132
+ ```ruby
133
+ class Calculator
134
+ # @rbs (Integer, Integer) -> Integer
135
+ def add(a, b) = a + b
136
+ end
137
+ ```
138
+
139
+ Note: RBS inline is still experimental and may change in future releases.
140
+
141
+ This release also introduces two language changes: type argument support for singleton types (`singleton(T)[S]`) mainly for Sorbet integration, and generic type parameter lower bounds (`T < S`).
142
+
143
+ ### Signature updates
144
+
145
+ **Updated classes/modules/methods:** `Addrinfo`, `Array`, `BasicObject`, `BigDecimal`, `Binding`, `CGI`, `Comparable`, `Complex`, `Digest::SHA2`, `Encoding::Converter`, `Enumerable`, `Enumerator`, `Enumerator::ArithmeticSequence`, `Enumerator::Lazy`, `Fiber`, `File`, `FileUtils`, `Float`, `Hash`, `IO`, `IO::TimeoutError`, `Integer`, `JSON`, `Kernel`, `Kconv`, `Math`, `Method`, `Minitest`, `Module`, `Numeric`, `ObjectSpace`, `Open3`, `OpenURI`, `OptionParser`, `PStore`, `Pathname`, `Proc`, `Process::Status`, `Psych`, `Ractor`, `Random`, `Random::Formatter`, `Range`, `Rational`, `RBS::Unnamed::TopLevelSelfClass`, `Ripper::Lexer::Elem`, `Ruby`, `RubyVM`, `SecureRandom`, `Set`, `Socket`, `String`, `StringScanner`, `TCPSocket`, `Thread`, `URI`, `URI::Generic`, `Zlib::GzipReader`, `Zlib::GzipWriter`
146
+
147
+ * Remove deprecated types ([#2880](https://github.com/ruby/rbs/pull/2880))
148
+ * Add type `RBS::Unnamed::TopLevelSelfClass` to core ([#2362](https://github.com/ruby/rbs/pull/2362))
149
+ * Graduate bundled gems from Ruby v4.0 ([#2852](https://github.com/ruby/rbs/pull/2852))
150
+ * stdlib: Add missing Psych methods and exception classes ([#2850](https://github.com/ruby/rbs/pull/2850))
151
+ * Add variants with positional argument to `Hash#transform_keys` ([#2848](https://github.com/ruby/rbs/pull/2848))
152
+ * add extra kwarg options for File#initialize and derivatives ([#2798](https://github.com/ruby/rbs/pull/2798))
153
+ * pstore: fixes types, treat it as a collection ([#2806](https://github.com/ruby/rbs/pull/2806))
154
+ * Add signatures for `{Module,Proc}#ruby2_keywords` ([#2805](https://github.com/ruby/rbs/pull/2805))
155
+ * Make Zlib::GzipWriter.new level and strategy parameters optional ([#2810](https://github.com/ruby/rbs/pull/2810))
156
+ * URI.(s) does string coercion ([#2825](https://github.com/ruby/rbs/pull/2825))
157
+ * Fix String#append_as_bytes to accept Integer ([#2817](https://github.com/ruby/rbs/pull/2817))
158
+ * [Comparable] Add in Comparable::_CompareToZero ([#2697](https://github.com/ruby/rbs/pull/2697))
159
+ * [Kernel] Add Kernel.trace_var and Kernel.untrace_var ([#2682](https://github.com/ruby/rbs/pull/2682))
160
+ * Add signature for `Module#method_undefined` ([#2804](https://github.com/ruby/rbs/pull/2804))
161
+ * Fix Zlib::GzipWriter signatures ([#2803](https://github.com/ruby/rbs/pull/2803))
162
+ * GzipWriter#initialize only takes 1 required positional arg ([#2799](https://github.com/ruby/rbs/pull/2799))
163
+ * Fix accessibility of method in Module ([#2802](https://github.com/ruby/rbs/pull/2802))
164
+ * Graduate kconv ([#2794](https://github.com/ruby/rbs/pull/2794))
165
+ * Fix test related to pathname ([#2789](https://github.com/ruby/rbs/pull/2789))
166
+ * Split pathname to core and stdlib ([#2777](https://github.com/ruby/rbs/pull/2777))
167
+ * [Kernel] Narrow `caller_locations` ([#2745](https://github.com/ruby/rbs/pull/2745))
168
+ * Ruby 4.1 changed `source_location` type ([#2784](https://github.com/ruby/rbs/pull/2784))
169
+ * Remove ObjectSpace.count_nodes ([#2779](https://github.com/ruby/rbs/pull/2779))
170
+ * Support selector for `String#strip` family. ([#2775](https://github.com/ruby/rbs/pull/2775))
171
+ * Add `Ruby`, `Array#find`, and `Array#rfind` ([#2767](https://github.com/ruby/rbs/pull/2767))
172
+ * Update minitest ([#2761](https://github.com/ruby/rbs/pull/2761))
173
+ * Support BigDecimal v4 ([#2758](https://github.com/ruby/rbs/pull/2758))
174
+ * Update rdoc and comments ([#2733](https://github.com/ruby/rbs/pull/2733))
175
+ * Update cgi and cgi/escape type definitions ([#2728](https://github.com/ruby/rbs/pull/2728))
176
+ * Update RBS files for Ruby 4 ([#2731](https://github.com/ruby/rbs/pull/2731))
177
+ * Update existing docs ([#2724](https://github.com/ruby/rbs/pull/2724))
178
+ * Remove reference to `JSON.deep_const_get` ([#2701](https://github.com/ruby/rbs/pull/2701))
179
+ * Remove deprecated methods in `JSON` ([#2366](https://github.com/ruby/rbs/pull/2366))
180
+ * Update FileUtils to v1.8.0 ([#2700](https://github.com/ruby/rbs/pull/2700))
181
+ * Avoid overloading where arguments are identical ([#2559](https://github.com/ruby/rbs/pull/2559))
182
+ * Move Pathname to core from stdlib ([#2705](https://github.com/ruby/rbs/pull/2705))
183
+ * Remove undocumented `#nonzero?` ([#2543](https://github.com/ruby/rbs/pull/2543))
184
+ * Add signature for `OptionParser#raise_unknown` ([#2735](https://github.com/ruby/rbs/pull/2735))
185
+ * Add signature for `Open3.popen2` ([#2734](https://github.com/ruby/rbs/pull/2734))
186
+ * Add RFC2396_PARSER to URI module ([#2727](https://github.com/ruby/rbs/pull/2727))
187
+ * Add signature for `Open3.capture3` ([#2714](https://github.com/ruby/rbs/pull/2714))
188
+ * Remove sig for IO#{ready?,nread} ([#2710](https://github.com/ruby/rbs/pull/2710))
189
+ * Accept `nil` state parameter in `to_json` type signatures ([#2691](https://github.com/ruby/rbs/pull/2691))
190
+ * Add type of `Open3.popen3` ([#2699](https://github.com/ruby/rbs/pull/2699))
191
+ * `unsetenv_others` and `close_others` only allows bool. ([#2698](https://github.com/ruby/rbs/pull/2698))
192
+ * Add deprecated annotation to `attr` with bool args ([#2693](https://github.com/ruby/rbs/pull/2693))
193
+ * Update open3 ([#2692](https://github.com/ruby/rbs/pull/2692))
194
+ * Add signature for `SecureRandom.bytes` ([#2690](https://github.com/ruby/rbs/pull/2690))
195
+ * Set %a{deprecated} to deprecated core methods ([#2664](https://github.com/ruby/rbs/pull/2664))
196
+ * Migrate usages of ::_ToPath to use ::path instead ([#2677](https://github.com/ruby/rbs/pull/2677))
197
+ * Add missing signatures for `Random::Formatter` ([#2680](https://github.com/ruby/rbs/pull/2680))
198
+ * Split `Random::Formatter` to core and stdlib ([#2661](https://github.com/ruby/rbs/pull/2661))
199
+ * Skip test cases of developing methods for Pathname ([#2648](https://github.com/ruby/rbs/pull/2648))
200
+ * Add signature `Random.seed` ([#2649](https://github.com/ruby/rbs/pull/2649))
201
+ * Update `string.rbs` to avoid deprecation warning in Steep ([#2655](https://github.com/ruby/rbs/pull/2655))
202
+ * Add sig `IO#pread` and `IO#pwrite` ([#2647](https://github.com/ruby/rbs/pull/2647))
203
+ * Refine signature of `Numeric#step` and add type of `Enumerator::ArithmeticSequence` ([#2600](https://github.com/ruby/rbs/pull/2600))
204
+ * Remove undocumented override methods ([#2622](https://github.com/ruby/rbs/pull/2622))
205
+ * Add docs ([#2625](https://github.com/ruby/rbs/pull/2625))
206
+ * Remove undocumented methods for `imaginary` ([#2620](https://github.com/ruby/rbs/pull/2620))
207
+ * Update securerandom ([#2619](https://github.com/ruby/rbs/pull/2619))
208
+ * Drop undocumented `#eql?` ([#2618](https://github.com/ruby/rbs/pull/2618))
209
+ * Just use `Numeric#+@` and return self ([#2597](https://github.com/ruby/rbs/pull/2597))
210
+ * Drop undocumented `#dup` ([#2598](https://github.com/ruby/rbs/pull/2598))
211
+ * Add signature for `Digest::SHA2` ([#2573](https://github.com/ruby/rbs/pull/2573))
212
+ * Add signatures for `OpenURI` ([#2574](https://github.com/ruby/rbs/pull/2574))
213
+ * Add signature for `IO::TimeoutError` ([#2571](https://github.com/ruby/rbs/pull/2571))
214
+ * Add signatures for `Set` ([#2570](https://github.com/ruby/rbs/pull/2570))
215
+ * Add signature for `Enumerator#+` ([#2567](https://github.com/ruby/rbs/pull/2567))
216
+ * Add signature for `Enumerator::Lazy#eager` ([#2568](https://github.com/ruby/rbs/pull/2568))
217
+ * Add signature for `Fiber#blocking` ([#2566](https://github.com/ruby/rbs/pull/2566))
218
+ * Support BasicObject to avoid NoMethodError for `RBS::Test::TypeCheck` ([#2565](https://github.com/ruby/rbs/pull/2565))
219
+ * Add documentation for `Range#{minmax,count,to_a,entries}` ([#2562](https://github.com/ruby/rbs/pull/2562))
220
+ * Delegate to `Enumerable` from `Range#{min,max}` ([#2540](https://github.com/ruby/rbs/pull/2540))
221
+ * Add URI::Generic#+ ([#2535](https://github.com/ruby/rbs/pull/2535))
222
+ * Make IO.binread, IO.binwrite, IO.read and IO.write accept _ToPath ([#2378](https://github.com/ruby/rbs/pull/2378))
223
+ * Support pattern argument for Enumerable#{all,any,none,one}? ([#2368](https://github.com/ruby/rbs/pull/2368))
224
+ * fixing sig for addrinfo ([#2464](https://github.com/ruby/rbs/pull/2464))
225
+
226
+ ### Language updates
227
+
228
+ * Add type arguments support to singleton types ([#2502](https://github.com/ruby/rbs/pull/2502))
229
+ * Move the note about lower bound ([#2517](https://github.com/ruby/rbs/pull/2517))
230
+ * Add support for lower bounds in type parameters ([#2490](https://github.com/ruby/rbs/pull/2490))
231
+
232
+ ### Library changes
233
+
234
+ * Add `#type_fingerprint` methods ([#2879](https://github.com/ruby/rbs/pull/2879))
235
+ * `top` for membership predicates of collection types ([#2878](https://github.com/ruby/rbs/pull/2878))
236
+ * Add block parameter (`&block`) type declaration ([#2875](https://github.com/ruby/rbs/pull/2875))
237
+ * Add splat (`*a`) and double-splat (`**a`) parameter support ([#2873](https://github.com/ruby/rbs/pull/2873))
238
+ * Add parameter type inline annotation ([#2443](https://github.com/ruby/rbs/pull/2443))
239
+ * Reduce compile warnings ([#2871](https://github.com/ruby/rbs/pull/2871))
240
+ * Specify input range by byte offsets ([#2863](https://github.com/ruby/rbs/pull/2863))
241
+ * add `extern "C"` wrapping to `rbs.h` when using C++ ([#2855](https://github.com/ruby/rbs/pull/2855))
242
+ * Automatically inherits super method type if unannotated ([#2858](https://github.com/ruby/rbs/pull/2858))
243
+ * Add `...` syntax to method type inline annotation syntax ([#2856](https://github.com/ruby/rbs/pull/2856))
244
+ * Fix for string reference corruption issue ([#2836](https://github.com/ruby/rbs/pull/2836))
245
+ * Use unreleased steep for `rake typecheck_test` ([#2842](https://github.com/ruby/rbs/pull/2842))
246
+ * Fix breaking references after GC.compact ([#2822](https://github.com/ruby/rbs/pull/2822))
247
+ * Fix special methods accessibility. ([#2546](https://github.com/ruby/rbs/pull/2546))
248
+ * Fix allocation alignment ([#2788](https://github.com/ruby/rbs/pull/2788))
249
+ * Skip `set` and `pathname` from `manifest.yaml` ([#2773](https://github.com/ruby/rbs/pull/2773))
250
+ * Fix C++ compiler warnings ([#2755](https://github.com/ruby/rbs/pull/2755))
251
+ * Better encoding ([#2675](https://github.com/ruby/rbs/pull/2675))
252
+ * Move `require_eof` handling to C API ([#2678](https://github.com/ruby/rbs/pull/2678))
253
+ * Delete debug print ([#2753](https://github.com/ruby/rbs/pull/2753))
254
+ * Make assertions macro ([#2729](https://github.com/ruby/rbs/pull/2729))
255
+ * Remove deprecated method `Kernel#Namespace`. Also remove `Kernel#TypeName`. ([#2480](https://github.com/ruby/rbs/pull/2480))
256
+ * Update rdoc to 6.13.1 ([#2355](https://github.com/ruby/rbs/pull/2355))
257
+ * Allow `self` for inline `@rbs @ivar: self` ([#2633](https://github.com/ruby/rbs/pull/2633))
258
+ * Normalize modules during type name resolution ([#2670](https://github.com/ruby/rbs/pull/2670))
259
+ * Only load extconf_compile_commands_json when compiling through Rake ([#2498](https://github.com/ruby/rbs/pull/2498))
260
+ * Use `malloc` based allocator ([#2666](https://github.com/ruby/rbs/pull/2666))
261
+ * Add another parser benchmark script ([#2668](https://github.com/ruby/rbs/pull/2668))
262
+ * Reuse empty array and hash ([#2667](https://github.com/ruby/rbs/pull/2667))
263
+ * Faster lexical analyzer ([#2665](https://github.com/ruby/rbs/pull/2665))
264
+ * Introduce `type_fingerprint` ([#2644](https://github.com/ruby/rbs/pull/2644))
265
+ * Add module-class alias declaration ([#2636](https://github.com/ruby/rbs/pull/2636))
266
+ * Inline constant declaration ([#2635](https://github.com/ruby/rbs/pull/2635))
267
+ * `self` type is rejected depending on the context ([#2627](https://github.com/ruby/rbs/pull/2627))
268
+ * Add instance variable declaration annotation ([#2632](https://github.com/ruby/rbs/pull/2632))
269
+ * Module-self allow void once ([#2626](https://github.com/ruby/rbs/pull/2626))
270
+ * Support inheritance in Inline RBS declaration ([#2630](https://github.com/ruby/rbs/pull/2630))
271
+ * Inline attribute/method definitions have comments ([#2624](https://github.com/ruby/rbs/pull/2624))
272
+ * Inline RBS declaration for attributes (`attr_***`) ([#2623](https://github.com/ruby/rbs/pull/2623))
273
+ * Fix bad scaling in `rbs_comment_t` tokens ([#2578](https://github.com/ruby/rbs/pull/2578))
274
+ * Update parser so that `void` type is rejected depending on the context ([#2590](https://github.com/ruby/rbs/pull/2590))
275
+ * Implement mixin in inline RBS declarations ([#2614](https://github.com/ruby/rbs/pull/2614))
276
+ * Validate type args given to non-generic ancestor ([#2615](https://github.com/ruby/rbs/pull/2615))
277
+ * Add name locations to AST ([#2595](https://github.com/ruby/rbs/pull/2595))
278
+ * Move `exit` calls to `exe/rbs` ([#2591](https://github.com/ruby/rbs/pull/2591))
279
+ * Fix locator ([#2588](https://github.com/ruby/rbs/pull/2588))
280
+ * Introduce standalone C parser for RBS with arena allocation ([#2398](https://github.com/ruby/rbs/pull/2398))
281
+ * Fix subtraction of civar ([#2369](https://github.com/ruby/rbs/pull/2369))
282
+ * Buffer with empty string ([#2551](https://github.com/ruby/rbs/pull/2551))
283
+ * Fix unavailable MAP_ANONYMOUS ([#2470](https://github.com/ruby/rbs/pull/2470))
284
+ * Inline minor fix ([#2514](https://github.com/ruby/rbs/pull/2514))
285
+ * Enable `-Wc++-compat` ([#2463](https://github.com/ruby/rbs/pull/2463))
286
+ * Expose a method to parse type parameters ([#2457](https://github.com/ruby/rbs/pull/2457))
287
+ * Expose and fix `Block#location` ([#2456](https://github.com/ruby/rbs/pull/2456))
288
+ * Restore RBS::Environment#declarations for backwards-compatibility ([#2393](https://github.com/ruby/rbs/pull/2393))
289
+ * Implement `@rbs return: T` annotation ([#2406](https://github.com/ruby/rbs/pull/2406))
290
+ * Add `@rbs skip` annotation ([#2405](https://github.com/ruby/rbs/pull/2405))
291
+ * Inline annotations ([#2403](https://github.com/ruby/rbs/pull/2403))
292
+ * Inline `def` support ([#2392](https://github.com/ruby/rbs/pull/2392))
293
+ * Suppress to GCC warning with multi-line comment ([#2383](https://github.com/ruby/rbs/pull/2383))
294
+ * Add inline class/module declaration ([#2390](https://github.com/ruby/rbs/pull/2390))
295
+ * Add `RBS::Source::RBS` ([#2380](https://github.com/ruby/rbs/pull/2380))
296
+
297
+ #### rbs prototype
298
+
299
+ * [prototype runtime] Find redefined methods ([#2542](https://github.com/ruby/rbs/pull/2542))
300
+
301
+ #### rbs collection
302
+
303
+ ### Miscellaneous
304
+
305
+ * bundle update (2026-01-20) ([#2818](https://github.com/ruby/rbs/pull/2818))
306
+ * Ruby 4.0.1 ([#2823](https://github.com/ruby/rbs/pull/2823))
307
+ * [rbs/test] Check type arguments size ([#2809](https://github.com/ruby/rbs/pull/2809))
308
+ * Add tsort to testing dependencies ([#2795](https://github.com/ruby/rbs/pull/2795))
309
+ * Update ruby to 4.0 ([#2776](https://github.com/ruby/rbs/pull/2776))
310
+ * Ruby 4.0.0 preview3 ([#2764](https://github.com/ruby/rbs/pull/2764))
311
+ * Remove test code for bundled gems ([#2760](https://github.com/ruby/rbs/pull/2760))
312
+ * Fix `nil` size `Enumerator` test ([#2749](https://github.com/ruby/rbs/pull/2749))
313
+ * Fix tests for rbs_skip_tests in ruby repo ([#2725](https://github.com/ruby/rbs/pull/2725))
314
+ * Update rdoc to v6.16 ([#2721](https://github.com/ruby/rbs/pull/2721))
315
+ * Run CI with "4.0.0-preview2" ([#2718](https://github.com/ruby/rbs/pull/2718))
316
+ * Minor typo fix ([#2676](https://github.com/ruby/rbs/pull/2676))
317
+ * Add -j option to make ([#2658](https://github.com/ruby/rbs/pull/2658))
318
+ * Allows the use of a path list as RBS_SKIP_TESTS ([#2612](https://github.com/ruby/rbs/pull/2612))
319
+ * Fix clang-format ([#2589](https://github.com/ruby/rbs/pull/2589))
320
+ * Restrict the execution of the valgrind task to when the C code has been modified. ([#2552](https://github.com/ruby/rbs/pull/2552))
321
+ * Set force_ruby_platform for bundler when head ([#2555](https://github.com/ruby/rbs/pull/2555))
322
+ * More skip paths with valgrind ([#2557](https://github.com/ruby/rbs/pull/2557))
323
+ * Run the `Encoding::Converter` test ([#2550](https://github.com/ruby/rbs/pull/2550))
324
+ * Fix CI ([#2527](https://github.com/ruby/rbs/pull/2527))
325
+ * Replace reference with official documentation ([#2453](https://github.com/ruby/rbs/pull/2453))
326
+ * Add clangd integration for improved C extension development ([#2481](https://github.com/ruby/rbs/pull/2481))
327
+ * Setup clang format for C code ([#2437](https://github.com/ruby/rbs/pull/2437))
328
+ * Add `super` calls in `setup` ([#2484](https://github.com/ruby/rbs/pull/2484))
329
+ * Suppress warnings during testing ([#2370](https://github.com/ruby/rbs/pull/2370))
330
+ * Update rubocop-on-rbs and use plugins ([#2345](https://github.com/ruby/rbs/pull/2345))
331
+ * Fix error at Ruby CI ([#2445](https://github.com/ruby/rbs/pull/2445))
332
+ * Use `erb` instead of `set` for load path testing ([#2439](https://github.com/ruby/rbs/pull/2439))
333
+ * Skip loading ruby_memcheck ([#2349](https://github.com/ruby/rbs/pull/2349))
334
+ * Forcibly uninstall gems even if there is a dependency problem. ([#2346](https://github.com/ruby/rbs/pull/2346))
335
+
336
+ ## 3.10.4 (2026-03-25)
337
+
338
+ ### Library changes
339
+
340
+ #### rbs collection
341
+
342
+ * [Backport] [3.10] Fix: pathname not written to lockfile. ([#2896](https://github.com/ruby/rbs/pull/2896))
343
+
344
+ ## 3.10.3 (2026-01-30)
345
+
346
+ This is a minor fix around the dependency to `tsort`.
347
+
348
+ ## Pull Requests
349
+
350
+ * Merge pull request #2601 from ima1zumi/add-tsort-dep ([#2834](https://github.com/ruby/rbs/pull/2834))
351
+
352
+ ## 3.10.2 (2026-01-07)
353
+
354
+ This is a minor fix on arena allocator alignment.
355
+
356
+ ### Pull Requests
357
+
358
+ * Merge pull request #2788 from ruby/fix-alloc-alignment ([#2790](https://github.com/ruby/rbs/pull/2790))
359
+
360
+ ## 3.10.1 (2026-01-07)
361
+
362
+ This is a follow-up release for Ruby 4.0.0 with documentation update based on Ruby 4.0.0, and bugfixes related to set/pathname library loading.
363
+
364
+ ### Pull Requests
365
+
366
+ * Merge pull request #2777 from ksss/pathname-ext ([#2786](https://github.com/ruby/rbs/pull/2786))
367
+ * Ruby 4.0.0 backports ([#2785](https://github.com/ruby/rbs/pull/2785))
368
+ * [Backport] Fix subtraction of civar ([#2783](https://github.com/ruby/rbs/pull/2783))
369
+ * [Backport] Update ruby to 4.0 ([#2778](https://github.com/ruby/rbs/pull/2778))
370
+
371
+ ## 3.10.0 (2025-12-23)
372
+
373
+ RBS 3.10.0 ships with a pure C parser implementation, signature updates for Ruby 4.0, and various bug fixes.
374
+
375
+ ### Pure C parser implementation
376
+
377
+ The new parser implementation was announced at [RubyKaigi 2025](https://rubykaigi.org/2025/presentations/amomchilov.html) and is finally shipped as a RubyGem!
378
+
379
+ The new parser is faster than the one in 3.9 and is portable — it is independent of the Ruby runtime and is used to implement Sorbet’s RBS support.
380
+
381
+ ### Type definition of bundled gems
382
+
383
+ The type definitions of `cgi` have been moved to [gem_rbs_collection](https://github.com/ruby/gem_rbs_collection/tree/main/gems/cgi), as it has been migrated to a bundled gem in Ruby 4.0
384
+
385
+ `cgi-escape` has been added to `stdlib`. You may need to declare a dependency on `cgi-escape` in your `manifest.yaml`, add `-r cgi-escape` to your command line, or update your type checker configuration.
386
+
387
+ ```yaml
388
+ dependencies:
389
+ - name: cgi-escape
390
+ ```
391
+
392
+ The type definitions for `pathname` have also been moved from `stdlib` to `core`, as it is now implemented as part of the core library.
393
+
394
+ ### Pull Requests
395
+
396
+ * [Backport] Support rdoc v7 ([#2770](https://github.com/ruby/rbs/pull/2770))
397
+ * [Backport] Check tuple type length ([#2766](https://github.com/ruby/rbs/pull/2766))
398
+ * Backport update to 4.0.0-preview3 ([#2768](https://github.com/ruby/rbs/pull/2768))
399
+ * [Backport] Remove test code for bundled gems ([#2762](https://github.com/ruby/rbs/pull/2762))
400
+ * Merge pull request #2761 from ruby/update-minitest ([#2763](https://github.com/ruby/rbs/pull/2763))
401
+ * [Backport] Support BigDecimal v4 ([#2759](https://github.com/ruby/rbs/pull/2759))
402
+ * Parser/lexer backports ([#2756](https://github.com/ruby/rbs/pull/2756))
403
+ * Merge pull request #2753 from ruby/delete-printf ([#2754](https://github.com/ruby/rbs/pull/2754))
404
+ * Backports ([#2751](https://github.com/ruby/rbs/pull/2751))
405
+ * Merge pull request #2728 from ruby/cgi ([#2747](https://github.com/ruby/rbs/pull/2747))
406
+ * Merge pull request #2729 from ruby/rbs-assert ([#2748](https://github.com/ruby/rbs/pull/2748))
407
+ * Merge pull request #2749 from ruby/fix-test ([#2750](https://github.com/ruby/rbs/pull/2750))
408
+ * Backport RBS file updates ([#2742](https://github.com/ruby/rbs/pull/2742))
409
+ * Backport JSON PRs ([#2740](https://github.com/ruby/rbs/pull/2740))
410
+ * Merge pull request #2718 from ruby/ruby-4 ([#2741](https://github.com/ruby/rbs/pull/2741))
411
+ * [Backport] Move Pathname to core from stdlib ([#2730](https://github.com/ruby/rbs/pull/2730))
412
+ * Backport rdoc 6.16 ([#2722](https://github.com/ruby/rbs/pull/2722))
413
+ * Backport rdoc support ([#2719](https://github.com/ruby/rbs/pull/2719))
414
+ * Backport "Remove sig for IO#{ready?,nread}" ([#2720](https://github.com/ruby/rbs/pull/2720))
415
+ * Backport more pure C parsers ([#2679](https://github.com/ruby/rbs/pull/2679))
416
+ * Backport module name normalization ([#2673](https://github.com/ruby/rbs/pull/2673))
417
+ * Backport pure-C parser ([#2671](https://github.com/ruby/rbs/pull/2671))
418
+ * Fix test failure ([#2672](https://github.com/ruby/rbs/pull/2672))
419
+
420
+ ## 3.9.5 (2025-09-08)
421
+
422
+ ### Signature updates
423
+
424
+ * Merge pull request #2655 from ruby/silence-string-deprecation ([#2656](https://github.com/ruby/rbs/pull/2656))
425
+
426
+ ### Miscellaneous
427
+
428
+ * Allows the use of a path list as RBS_SKIP_TESTS ([#2641](https://github.com/ruby/rbs/pull/2641))
429
+ * Suppress to GCC warning with multi-line comment ([#2646](https://github.com/ruby/rbs/pull/2646))
430
+ * Backport to 3.9 ([#2487](https://github.com/ruby/rbs/pull/2487))
431
+ * Use erb instead of set for load path testing ([#2468](https://github.com/ruby/rbs/pull/2468))
432
+
3
433
  ## 3.9.4 (2025-05-15)
4
434
 
5
435
  ### Miscellaneous
data/Dockerfile.jruby ADDED
@@ -0,0 +1,53 @@
1
+ # JRuby verification image for RBS.
2
+ #
3
+ # RBS can't load its MRI C extension on JRuby, so it parses through a
4
+ # WebAssembly build of the parser (see lib/rbs/wasm and docs/wasm_serialization.md).
5
+ # This single-stage image installs the WASI SDK, compiles rbs_parser.wasm and
6
+ # downloads the Chicory/ASM jars into ~/.m2 (via jar-dependencies), then runs the
7
+ # test suite on JRuby. It mirrors .github/workflows/jruby.yml but is self-contained.
8
+ #
9
+ # docker build -f Dockerfile.jruby -t rbs-jruby .
10
+ # docker run --rm rbs-jruby # run the test suite
11
+ # docker run --rm -e RBS_PLATFORM=java rbs-jruby \
12
+ # gem build rbs.gemspec # build the -java gem
13
+ #
14
+ # Bundler is intentionally not used: the development Gemfile pulls in CRuby-only
15
+ # C extensions (bigdecimal, stackprof, ...) that cannot build on JRuby. The few
16
+ # gems the suite needs are installed directly, exactly as the CI does.
17
+
18
+ FROM jruby:10.1.1.0-jdk21
19
+
20
+ # Keep in sync with .github/workflows/wasm.yml and .github/workflows/jruby.yml.
21
+ ARG WASI_SDK_VERSION=33
22
+ ARG WASI_SDK_RELEASE=33.0
23
+
24
+ # build-essential supplies cc/make: on JRuby the prism gem builds libprism.so
25
+ # (loaded via FFI) instead of an MRI C extension, so it needs a C toolchain.
26
+ RUN apt-get update \
27
+ && apt-get install -y --no-install-recommends git curl ca-certificates build-essential \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ # The WASI SDK provides clang, the wasi-libc sysroot and the wasm32 compiler-rt
31
+ # builtins that `rake wasm:build` needs to compile src/**/*.c to WebAssembly.
32
+ RUN set -eux; \
33
+ case "$(uname -m)" in \
34
+ x86_64 | amd64) wasi_arch=x86_64 ;; \
35
+ aarch64 | arm64) wasi_arch=arm64 ;; \
36
+ *) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; \
37
+ esac; \
38
+ mkdir -p /opt/wasi-sdk; \
39
+ curl -fsSL "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_RELEASE}-${wasi_arch}-linux.tar.gz" \
40
+ | tar xz --strip-components=1 -C /opt/wasi-sdk
41
+ ENV WASI_SDK_PATH=/opt/wasi-sdk
42
+
43
+ # Runtime/test gems the suite needs on JRuby (same set as the jruby.yml CI).
44
+ RUN gem install prism rake rake-compiler test-unit rdoc rspec minitest json-schema pry --no-document
45
+
46
+ WORKDIR /rbs
47
+ COPY . .
48
+
49
+ # Compile rbs_parser.wasm (clang is a subprocess, so the build is engine
50
+ # independent) and download the Chicory + ASM jars into ~/.m2 via jar-dependencies.
51
+ RUN rake wasm:jruby_setup wasm:install_jars
52
+
53
+ CMD ["rake", "test"]
data/README.md CHANGED
@@ -54,8 +54,8 @@ end
54
54
 
55
55
  ## The Target Version
56
56
 
57
- * The standard library signatures targets the latest release of Ruby. (`3.2` as of 2023.)
58
- * The library code targets non-EOL versions of Ruby. (`>= 3.0` as of 2023.)
57
+ * The standard library signatures targets the [latest release of Ruby](https://www.ruby-lang.org/en/downloads/branches/). (`4.0` as of 2026.)
58
+ * The library code targets [non-EOL versions of Ruby](https://www.ruby-lang.org/en/downloads/branches/). (`>= 3.3` as of 2026.)
59
59
 
60
60
  ## Installation
61
61
 
@@ -122,7 +122,7 @@ This is only a starting point, and you should edit the output to match your sign
122
122
 
123
123
  - `rb` generates from just the available Ruby code
124
124
  - `rbi` generates from Sorbet RBI
125
- - `runtime` generates from runtime API
125
+ - `runtime` generates from runtime API (**deprecated**; see [#2841](https://github.com/ruby/rbs/issues/2841))
126
126
 
127
127
  ## Library
128
128
 
@@ -141,7 +141,7 @@ require "rbs"
141
141
  loader = RBS::EnvironmentLoader.new()
142
142
 
143
143
  # loader.add(path: Pathname("sig")) # Load .rbs files from `sig` directory
144
- # loader.add(library: "pathname") # Load pathname library
144
+ # loader.add(library: "logger") # Load logger library
145
145
 
146
146
  environment = RBS::Environment.from_loader(loader).resolve_type_names
147
147
 
@@ -198,6 +198,43 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
198
198
 
199
199
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
200
200
 
201
+ ### C Code Formatting
202
+
203
+ This project uses `clang-format` to enforce consistent formatting of C code with a `.clang-format` configuration in the root directory.
204
+
205
+ #### Setup
206
+
207
+ First, install clang-format:
208
+
209
+ ```bash
210
+ # macOS
211
+ brew install clang-format
212
+
213
+ # Ubuntu/Debian
214
+ sudo apt-get install clang-format
215
+
216
+ # Windows
217
+ choco install llvm
218
+ ```
219
+
220
+ #### Usage
221
+
222
+ Format all C source files:
223
+
224
+ ```bash
225
+ rake format:c
226
+ ```
227
+
228
+ Check formatting without making changes:
229
+
230
+ ```bash
231
+ rake format:c_check
232
+ ```
233
+
234
+ #### Editor Integration
235
+
236
+ For VS Code users, install the "clangd" extension which will automatically use the project's `.clang-format` file.
237
+
201
238
  ## Contributing
202
239
 
203
240
  Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rbs.