1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Bundle RBS 2.0.0 (#5330)

* Bundle RBS 2.0.0

* Update NEWS.md
This commit is contained in:
Soutaro Matsumoto 2021-12-24 22:54:45 +09:00 committed by GitHub
parent 0aca70e559
commit 8d940e3032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2021-12-24 22:55:05 +09:00
Merged-By: soutaro <matsumoto@soutaro.com>
2 changed files with 31 additions and 2 deletions

31
NEWS.md
View file

@ -368,7 +368,7 @@ Note: We're only listing outstanding class updates.
* rake 13.0.6
* test-unit 3.5.3
* rexml 3.2.5
* rbs 1.8.1
* rbs 2.0.0
* typeprof 0.21.1
* The following default gems are now bundled gems.
* net-ftp 0.1.3
@ -469,8 +469,37 @@ See [this blog post](https://shopify.engineering/yjit-just-in-time-compiler-crub
### RBS
* Generics type parameters can be bounded ([PR](https://github.com/ruby/rbs/pull/844)).
```rbs
# `T` must be compatible with the `_Output` interface.
# `PrettyPrint[String]` is ok, but `PrettyPrint[Integer]` is a type error.
class PrettyPrint[T < _Output]
interface _Output
def <<: (String) -> void
end
attr_reader output: T
def initialize: (T output) -> void
end
```
* Type aliases can be generic. ([PR](https://github.com/ruby/rbs/pull/823))
```rbs
# Defines a generic type `list`.
type list[T] = [ T, list[T] ]
| nil
type str_list = list[String]
type int_list = list[Integer]
```
* [rbs collection](https://github.com/ruby/rbs/blob/master/docs/collection.md) has been introduced to manage gems RBSs.
* Many signatures for built-in and standard libraries have been added/updated.
* It includes many bug fixes and performance improvements too.
See the [CHANGELOG.md](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) for more information.

View file

@ -11,6 +11,6 @@ net-pop 0.1.1 https://github.com/ruby/net-pop
net-smtp 0.3.1 https://github.com/ruby/net-smtp
matrix 0.4.2 https://github.com/ruby/matrix
prime 0.1.2 https://github.com/ruby/prime
rbs 1.8.1 https://github.com/ruby/rbs
rbs 2.0.0 https://github.com/ruby/rbs
typeprof 0.21.1 https://github.com/ruby/typeprof
debug 1.4.0 https://github.com/ruby/debug