|
1 | 1 | # CHANGELOG |
2 | 2 |
|
| 3 | +## 4.0.0 (2026-03-16) |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +```ruby |
| 8 | +class Calculator |
| 9 | + # @rbs (Integer, Integer) -> Integer |
| 10 | + def add(a, b) = a + b |
| 11 | +end |
| 12 | +``` |
| 13 | +
|
| 14 | +Note: RBS inline is still experimental and may change in future releases. |
| 15 | +
|
| 16 | +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`). |
| 17 | +
|
| 18 | +### Signature updates |
| 19 | +
|
| 20 | +**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` |
| 21 | +
|
| 22 | +* Remove deprecated types ([#2880](https://github.com/ruby/rbs/pull/2880)) |
| 23 | +* Add type `RBS::Unnamed::TopLevelSelfClass` to core ([#2362](https://github.com/ruby/rbs/pull/2362)) |
| 24 | +* Graduate bundled gems from Ruby v4.0 ([#2852](https://github.com/ruby/rbs/pull/2852)) |
| 25 | +* stdlib: Add missing Psych methods and exception classes ([#2850](https://github.com/ruby/rbs/pull/2850)) |
| 26 | +* Add variants with positional argument to `Hash#transform_keys` ([#2848](https://github.com/ruby/rbs/pull/2848)) |
| 27 | +* add extra kwarg options for File#initialize and derivatives ([#2798](https://github.com/ruby/rbs/pull/2798)) |
| 28 | +* pstore: fixes types, treat it as a collection ([#2806](https://github.com/ruby/rbs/pull/2806)) |
| 29 | +* Add signatures for `{Module,Proc}#ruby2_keywords` ([#2805](https://github.com/ruby/rbs/pull/2805)) |
| 30 | +* Make Zlib::GzipWriter.new level and strategy parameters optional ([#2810](https://github.com/ruby/rbs/pull/2810)) |
| 31 | +* URI.(s) does string coercion ([#2825](https://github.com/ruby/rbs/pull/2825)) |
| 32 | +* Fix String#append_as_bytes to accept Integer ([#2817](https://github.com/ruby/rbs/pull/2817)) |
| 33 | +* [Comparable] Add in Comparable::_CompareToZero ([#2697](https://github.com/ruby/rbs/pull/2697)) |
| 34 | +* [Kernel] Add Kernel.trace_var and Kernel.untrace_var ([#2682](https://github.com/ruby/rbs/pull/2682)) |
| 35 | +* Add signature for `Module#method_undefined` ([#2804](https://github.com/ruby/rbs/pull/2804)) |
| 36 | +* Fix Zlib::GzipWriter signatures ([#2803](https://github.com/ruby/rbs/pull/2803)) |
| 37 | +* GzipWriter#initialize only takes 1 required positional arg ([#2799](https://github.com/ruby/rbs/pull/2799)) |
| 38 | +* Fix accessibility of method in Module ([#2802](https://github.com/ruby/rbs/pull/2802)) |
| 39 | +* Graduate kconv ([#2794](https://github.com/ruby/rbs/pull/2794)) |
| 40 | +* Fix test related to pathname ([#2789](https://github.com/ruby/rbs/pull/2789)) |
| 41 | +* Split pathname to core and stdlib ([#2777](https://github.com/ruby/rbs/pull/2777)) |
| 42 | +* [Kernel] Narrow `caller_locations` ([#2745](https://github.com/ruby/rbs/pull/2745)) |
| 43 | +* Ruby 4.1 changed `source_location` type ([#2784](https://github.com/ruby/rbs/pull/2784)) |
| 44 | +* Remove ObjectSpace.count_nodes ([#2779](https://github.com/ruby/rbs/pull/2779)) |
| 45 | +* Support selector for `String#strip` family. ([#2775](https://github.com/ruby/rbs/pull/2775)) |
| 46 | +* Add `Ruby`, `Array#find`, and `Array#rfind` ([#2767](https://github.com/ruby/rbs/pull/2767)) |
| 47 | +* Update minitest ([#2761](https://github.com/ruby/rbs/pull/2761)) |
| 48 | +* Support BigDecimal v4 ([#2758](https://github.com/ruby/rbs/pull/2758)) |
| 49 | +* Update rdoc and comments ([#2733](https://github.com/ruby/rbs/pull/2733)) |
| 50 | +* Update cgi and cgi/escape type definitions ([#2728](https://github.com/ruby/rbs/pull/2728)) |
| 51 | +* Update RBS files for Ruby 4 ([#2731](https://github.com/ruby/rbs/pull/2731)) |
| 52 | +* Update existing docs ([#2724](https://github.com/ruby/rbs/pull/2724)) |
| 53 | +* Remove reference to `JSON.deep_const_get` ([#2701](https://github.com/ruby/rbs/pull/2701)) |
| 54 | +* Remove deprecated methods in `JSON` ([#2366](https://github.com/ruby/rbs/pull/2366)) |
| 55 | +* Update FileUtils to v1.8.0 ([#2700](https://github.com/ruby/rbs/pull/2700)) |
| 56 | +* Avoid overloading where arguments are identical ([#2559](https://github.com/ruby/rbs/pull/2559)) |
| 57 | +* Move Pathname to core from stdlib ([#2705](https://github.com/ruby/rbs/pull/2705)) |
| 58 | +* Remove undocumented `#nonzero?` ([#2543](https://github.com/ruby/rbs/pull/2543)) |
| 59 | +* Add signature for `OptionParser#raise_unknown` ([#2735](https://github.com/ruby/rbs/pull/2735)) |
| 60 | +* Add signature for `Open3.popen2` ([#2734](https://github.com/ruby/rbs/pull/2734)) |
| 61 | +* Add RFC2396_PARSER to URI module ([#2727](https://github.com/ruby/rbs/pull/2727)) |
| 62 | +* Add signature for `Open3.capture3` ([#2714](https://github.com/ruby/rbs/pull/2714)) |
| 63 | +* Remove sig for IO#{ready?,nread} ([#2710](https://github.com/ruby/rbs/pull/2710)) |
| 64 | +* Accept `nil` state parameter in `to_json` type signatures ([#2691](https://github.com/ruby/rbs/pull/2691)) |
| 65 | +* Add type of `Open3.popen3` ([#2699](https://github.com/ruby/rbs/pull/2699)) |
| 66 | +* `unsetenv_others` and `close_others` only allows bool. ([#2698](https://github.com/ruby/rbs/pull/2698)) |
| 67 | +* Add deprecated annotation to `attr` with bool args ([#2693](https://github.com/ruby/rbs/pull/2693)) |
| 68 | +* Update open3 ([#2692](https://github.com/ruby/rbs/pull/2692)) |
| 69 | +* Add signature for `SecureRandom.bytes` ([#2690](https://github.com/ruby/rbs/pull/2690)) |
| 70 | +* Set %a{deprecated} to deprecated core methods ([#2664](https://github.com/ruby/rbs/pull/2664)) |
| 71 | +* Migrate usages of ::_ToPath to use ::path instead ([#2677](https://github.com/ruby/rbs/pull/2677)) |
| 72 | +* Add missing signatures for `Random::Formatter` ([#2680](https://github.com/ruby/rbs/pull/2680)) |
| 73 | +* Split `Random::Formatter` to core and stdlib ([#2661](https://github.com/ruby/rbs/pull/2661)) |
| 74 | +* Skip test cases of developing methods for Pathname ([#2648](https://github.com/ruby/rbs/pull/2648)) |
| 75 | +* Add signature `Random.seed` ([#2649](https://github.com/ruby/rbs/pull/2649)) |
| 76 | +* Update `string.rbs` to avoid deprecation warning in Steep ([#2655](https://github.com/ruby/rbs/pull/2655)) |
| 77 | +* Add sig `IO#pread` and `IO#pwrite` ([#2647](https://github.com/ruby/rbs/pull/2647)) |
| 78 | +* Refine signature of `Numeric#step` and add type of `Enumerator::ArithmeticSequence` ([#2600](https://github.com/ruby/rbs/pull/2600)) |
| 79 | +* Remove undocumented override methods ([#2622](https://github.com/ruby/rbs/pull/2622)) |
| 80 | +* Add docs ([#2625](https://github.com/ruby/rbs/pull/2625)) |
| 81 | +* Remove undocumented methods for `imaginary` ([#2620](https://github.com/ruby/rbs/pull/2620)) |
| 82 | +* Update securerandom ([#2619](https://github.com/ruby/rbs/pull/2619)) |
| 83 | +* Drop undocumented `#eql?` ([#2618](https://github.com/ruby/rbs/pull/2618)) |
| 84 | +* Just use `Numeric#+@` and return self ([#2597](https://github.com/ruby/rbs/pull/2597)) |
| 85 | +* Drop undocumented `#dup` ([#2598](https://github.com/ruby/rbs/pull/2598)) |
| 86 | +* Add signature for `Digest::SHA2` ([#2573](https://github.com/ruby/rbs/pull/2573)) |
| 87 | +* Add signatures for `OpenURI` ([#2574](https://github.com/ruby/rbs/pull/2574)) |
| 88 | +* Add signature for `IO::TimeoutError` ([#2571](https://github.com/ruby/rbs/pull/2571)) |
| 89 | +* Add signatures for `Set` ([#2570](https://github.com/ruby/rbs/pull/2570)) |
| 90 | +* Add signature for `Enumerator#+` ([#2567](https://github.com/ruby/rbs/pull/2567)) |
| 91 | +* Add signature for `Enumerator::Lazy#eager` ([#2568](https://github.com/ruby/rbs/pull/2568)) |
| 92 | +* Add signature for `Fiber#blocking` ([#2566](https://github.com/ruby/rbs/pull/2566)) |
| 93 | +* Support BasicObject to avoid NoMethodError for `RBS::Test::TypeCheck` ([#2565](https://github.com/ruby/rbs/pull/2565)) |
| 94 | +* Add documentation for `Range#{minmax,count,to_a,entries}` ([#2562](https://github.com/ruby/rbs/pull/2562)) |
| 95 | +* Delegate to `Enumerable` from `Range#{min,max}` ([#2540](https://github.com/ruby/rbs/pull/2540)) |
| 96 | +* Add URI::Generic#+ ([#2535](https://github.com/ruby/rbs/pull/2535)) |
| 97 | +* Make IO.binread, IO.binwrite, IO.read and IO.write accept _ToPath ([#2378](https://github.com/ruby/rbs/pull/2378)) |
| 98 | +* Support pattern argument for Enumerable#{all,any,none,one}? ([#2368](https://github.com/ruby/rbs/pull/2368)) |
| 99 | +* fixing sig for addrinfo ([#2464](https://github.com/ruby/rbs/pull/2464)) |
| 100 | + |
| 101 | +### Language updates |
| 102 | + |
| 103 | +* Add type arguments support to singleton types ([#2502](https://github.com/ruby/rbs/pull/2502)) |
| 104 | +* Move the note about lower bound ([#2517](https://github.com/ruby/rbs/pull/2517)) |
| 105 | +* Add support for lower bounds in type parameters ([#2490](https://github.com/ruby/rbs/pull/2490)) |
| 106 | + |
| 107 | +### Library changes |
| 108 | + |
| 109 | +* Add `#type_fingerprint` methods ([#2879](https://github.com/ruby/rbs/pull/2879)) |
| 110 | +* `top` for membership predicates of collection types ([#2878](https://github.com/ruby/rbs/pull/2878)) |
| 111 | +* Add block parameter (`&block`) type declaration ([#2875](https://github.com/ruby/rbs/pull/2875)) |
| 112 | +* Add splat (`*a`) and double-splat (`**a`) parameter support ([#2873](https://github.com/ruby/rbs/pull/2873)) |
| 113 | +* Add parameter type inline annotation ([#2443](https://github.com/ruby/rbs/pull/2443)) |
| 114 | +* Reduce compile warnings ([#2871](https://github.com/ruby/rbs/pull/2871)) |
| 115 | +* Specify input range by byte offsets ([#2863](https://github.com/ruby/rbs/pull/2863)) |
| 116 | +* add `extern "C"` wrapping to `rbs.h` when using C++ ([#2855](https://github.com/ruby/rbs/pull/2855)) |
| 117 | +* Automatically inherits super method type if unannotated ([#2858](https://github.com/ruby/rbs/pull/2858)) |
| 118 | +* Add `...` syntax to method type inline annotation syntax ([#2856](https://github.com/ruby/rbs/pull/2856)) |
| 119 | +* Fix for string reference corruption issue ([#2836](https://github.com/ruby/rbs/pull/2836)) |
| 120 | +* Use unreleased steep for `rake typecheck_test` ([#2842](https://github.com/ruby/rbs/pull/2842)) |
| 121 | +* Fix breaking references after GC.compact ([#2822](https://github.com/ruby/rbs/pull/2822)) |
| 122 | +* Fix special methods accessibility. ([#2546](https://github.com/ruby/rbs/pull/2546)) |
| 123 | +* Fix allocation alignment ([#2788](https://github.com/ruby/rbs/pull/2788)) |
| 124 | +* Skip `set` and `pathname` from `manifest.yaml` ([#2773](https://github.com/ruby/rbs/pull/2773)) |
| 125 | +* Fix C++ compiler warnings ([#2755](https://github.com/ruby/rbs/pull/2755)) |
| 126 | +* Better encoding ([#2675](https://github.com/ruby/rbs/pull/2675)) |
| 127 | +* Move `require_eof` handling to C API ([#2678](https://github.com/ruby/rbs/pull/2678)) |
| 128 | +* Delete debug print ([#2753](https://github.com/ruby/rbs/pull/2753)) |
| 129 | +* Make assertions macro ([#2729](https://github.com/ruby/rbs/pull/2729)) |
| 130 | +* Remove deprecated method `Kernel#Namespace`. Also remove `Kernel#TypeName`. ([#2480](https://github.com/ruby/rbs/pull/2480)) |
| 131 | +* Update rdoc to 6.13.1 ([#2355](https://github.com/ruby/rbs/pull/2355)) |
| 132 | +* Allow `self` for inline `@rbs @ivar: self` ([#2633](https://github.com/ruby/rbs/pull/2633)) |
| 133 | +* Normalize modules during type name resolution ([#2670](https://github.com/ruby/rbs/pull/2670)) |
| 134 | +* Only load extconf_compile_commands_json when compiling through Rake ([#2498](https://github.com/ruby/rbs/pull/2498)) |
| 135 | +* Use `malloc` based allocator ([#2666](https://github.com/ruby/rbs/pull/2666)) |
| 136 | +* Add another parser benchmark script ([#2668](https://github.com/ruby/rbs/pull/2668)) |
| 137 | +* Reuse empty array and hash ([#2667](https://github.com/ruby/rbs/pull/2667)) |
| 138 | +* Faster lexical analyzer ([#2665](https://github.com/ruby/rbs/pull/2665)) |
| 139 | +* Introduce `type_fingerprint` ([#2644](https://github.com/ruby/rbs/pull/2644)) |
| 140 | +* Add module-class alias declaration ([#2636](https://github.com/ruby/rbs/pull/2636)) |
| 141 | +* Inline constant declaration ([#2635](https://github.com/ruby/rbs/pull/2635)) |
| 142 | +* `self` type is rejected depending on the context ([#2627](https://github.com/ruby/rbs/pull/2627)) |
| 143 | +* Add instance variable declaration annotation ([#2632](https://github.com/ruby/rbs/pull/2632)) |
| 144 | +* Module-self allow void once ([#2626](https://github.com/ruby/rbs/pull/2626)) |
| 145 | +* Support inheritance in Inline RBS declaration ([#2630](https://github.com/ruby/rbs/pull/2630)) |
| 146 | +* Inline attribute/method definitions have comments ([#2624](https://github.com/ruby/rbs/pull/2624)) |
| 147 | +* Inline RBS declaration for attributes (`attr_***`) ([#2623](https://github.com/ruby/rbs/pull/2623)) |
| 148 | +* Fix bad scaling in `rbs_comment_t` tokens ([#2578](https://github.com/ruby/rbs/pull/2578)) |
| 149 | +* Update parser so that `void` type is rejected depending on the context ([#2590](https://github.com/ruby/rbs/pull/2590)) |
| 150 | +* Implement mixin in inline RBS declarations ([#2614](https://github.com/ruby/rbs/pull/2614)) |
| 151 | +* Validate type args given to non-generic ancestor ([#2615](https://github.com/ruby/rbs/pull/2615)) |
| 152 | +* Add name locations to AST ([#2595](https://github.com/ruby/rbs/pull/2595)) |
| 153 | +* Move `exit` calls to `exe/rbs` ([#2591](https://github.com/ruby/rbs/pull/2591)) |
| 154 | +* Fix locator ([#2588](https://github.com/ruby/rbs/pull/2588)) |
| 155 | +* Introduce standalone C parser for RBS with arena allocation ([#2398](https://github.com/ruby/rbs/pull/2398)) |
| 156 | +* Fix subtraction of civar ([#2369](https://github.com/ruby/rbs/pull/2369)) |
| 157 | +* Buffer with empty string ([#2551](https://github.com/ruby/rbs/pull/2551)) |
| 158 | +* Fix unavailable MAP_ANONYMOUS ([#2470](https://github.com/ruby/rbs/pull/2470)) |
| 159 | +* Inline minor fix ([#2514](https://github.com/ruby/rbs/pull/2514)) |
| 160 | +* Enable `-Wc++-compat` ([#2463](https://github.com/ruby/rbs/pull/2463)) |
| 161 | +* Expose a method to parse type parameters ([#2457](https://github.com/ruby/rbs/pull/2457)) |
| 162 | +* Expose and fix `Block#location` ([#2456](https://github.com/ruby/rbs/pull/2456)) |
| 163 | +* Restore RBS::Environment#declarations for backwards-compatibility ([#2393](https://github.com/ruby/rbs/pull/2393)) |
| 164 | +* Implement `@rbs return: T` annotation ([#2406](https://github.com/ruby/rbs/pull/2406)) |
| 165 | +* Add `@rbs skip` annotation ([#2405](https://github.com/ruby/rbs/pull/2405)) |
| 166 | +* Inline annotations ([#2403](https://github.com/ruby/rbs/pull/2403)) |
| 167 | +* Inline `def` support ([#2392](https://github.com/ruby/rbs/pull/2392)) |
| 168 | +* Suppress to GCC warning with multi-line comment ([#2383](https://github.com/ruby/rbs/pull/2383)) |
| 169 | +* Add inline class/module declaration ([#2390](https://github.com/ruby/rbs/pull/2390)) |
| 170 | +* Add `RBS::Source::RBS` ([#2380](https://github.com/ruby/rbs/pull/2380)) |
| 171 | + |
| 172 | +#### rbs prototype |
| 173 | + |
| 174 | +* [prototype runtime] Find redefined methods ([#2542](https://github.com/ruby/rbs/pull/2542)) |
| 175 | + |
| 176 | +#### rbs collection |
| 177 | + |
| 178 | +### Miscellaneous |
| 179 | + |
| 180 | +* bundle update (2026-01-20) ([#2818](https://github.com/ruby/rbs/pull/2818)) |
| 181 | +* Ruby 4.0.1 ([#2823](https://github.com/ruby/rbs/pull/2823)) |
| 182 | +* [rbs/test] Check type arguments size ([#2809](https://github.com/ruby/rbs/pull/2809)) |
| 183 | +* Add tsort to testing dependencies ([#2795](https://github.com/ruby/rbs/pull/2795)) |
| 184 | +* Update ruby to 4.0 ([#2776](https://github.com/ruby/rbs/pull/2776)) |
| 185 | +* Ruby 4.0.0 preview3 ([#2764](https://github.com/ruby/rbs/pull/2764)) |
| 186 | +* Remove test code for bundled gems ([#2760](https://github.com/ruby/rbs/pull/2760)) |
| 187 | +* Fix `nil` size `Enumerator` test ([#2749](https://github.com/ruby/rbs/pull/2749)) |
| 188 | +* Fix tests for rbs_skip_tests in ruby repo ([#2725](https://github.com/ruby/rbs/pull/2725)) |
| 189 | +* Update rdoc to v6.16 ([#2721](https://github.com/ruby/rbs/pull/2721)) |
| 190 | +* Run CI with "4.0.0-preview2" ([#2718](https://github.com/ruby/rbs/pull/2718)) |
| 191 | +* Minor typo fix ([#2676](https://github.com/ruby/rbs/pull/2676)) |
| 192 | +* Add -j option to make ([#2658](https://github.com/ruby/rbs/pull/2658)) |
| 193 | +* Allows the use of a path list as RBS_SKIP_TESTS ([#2612](https://github.com/ruby/rbs/pull/2612)) |
| 194 | +* Fix clang-format ([#2589](https://github.com/ruby/rbs/pull/2589)) |
| 195 | +* Restrict the execution of the valgrind task to when the C code has been modified. ([#2552](https://github.com/ruby/rbs/pull/2552)) |
| 196 | +* Set force_ruby_platform for bundler when head ([#2555](https://github.com/ruby/rbs/pull/2555)) |
| 197 | +* More skip paths with valgrind ([#2557](https://github.com/ruby/rbs/pull/2557)) |
| 198 | +* Run the `Encoding::Converter` test ([#2550](https://github.com/ruby/rbs/pull/2550)) |
| 199 | +* Fix CI ([#2527](https://github.com/ruby/rbs/pull/2527)) |
| 200 | +* Replace reference with official documentation ([#2453](https://github.com/ruby/rbs/pull/2453)) |
| 201 | +* Add clangd integration for improved C extension development ([#2481](https://github.com/ruby/rbs/pull/2481)) |
| 202 | +* Setup clang format for C code ([#2437](https://github.com/ruby/rbs/pull/2437)) |
| 203 | +* Add `super` calls in `setup` ([#2484](https://github.com/ruby/rbs/pull/2484)) |
| 204 | +* Suppress warnings during testing ([#2370](https://github.com/ruby/rbs/pull/2370)) |
| 205 | +* Update rubocop-on-rbs and use plugins ([#2345](https://github.com/ruby/rbs/pull/2345)) |
| 206 | +* Fix error at Ruby CI ([#2445](https://github.com/ruby/rbs/pull/2445)) |
| 207 | +* Use `erb` instead of `set` for load path testing ([#2439](https://github.com/ruby/rbs/pull/2439)) |
| 208 | +* Skip loading ruby_memcheck ([#2349](https://github.com/ruby/rbs/pull/2349)) |
| 209 | +* Forcibly uninstall gems even if there is a dependency problem. ([#2346](https://github.com/ruby/rbs/pull/2346)) |
| 210 | + |
3 | 211 | ## 3.10.3 (2026-01-30) |
4 | 212 |
|
5 | 213 | This is a minor fix around the dependency to `tsort`. |
|
0 commit comments