mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
NEWS.md: mention TypeProf
This commit is contained in:
parent
451836f582
commit
a3ae90b8c5
Notes:
git
2020-10-20 22:49:06 +09:00
1 changed files with 35 additions and 2 deletions
37
NEWS.md
37
NEWS.md
|
@ -83,7 +83,9 @@ sufficient information, see the ChangeLog file or Redmine
|
||||||
* Interpolated String literals are no longer frozen when
|
* Interpolated String literals are no longer frozen when
|
||||||
`# frozen-string-literal: true` is used. [[Feature #17104]]
|
`# frozen-string-literal: true` is used. [[Feature #17104]]
|
||||||
|
|
||||||
* RBS is introduced. It is a type definition language for Ruby programs.
|
* A static analysis foundation is introduced. See "Static analysis" section in detail.
|
||||||
|
* RBS is introduced. It is a type definition language for Ruby programs.
|
||||||
|
* TypeProf is experimentally bundled. It is a type analysis tool for Ruby programs.
|
||||||
|
|
||||||
## Command line options
|
## Command line options
|
||||||
|
|
||||||
|
@ -417,7 +419,9 @@ Excluding feature bug fixes.
|
||||||
|
|
||||||
* Optimize C method call a little
|
* Optimize C method call a little
|
||||||
|
|
||||||
## RBS
|
## Statis analysis
|
||||||
|
|
||||||
|
### RBS
|
||||||
|
|
||||||
* RBS is a new language for type definition of Ruby programs.
|
* RBS is a new language for type definition of Ruby programs.
|
||||||
It allows writing types of classes and modules with advanced
|
It allows writing types of classes and modules with advanced
|
||||||
|
@ -428,6 +432,35 @@ Excluding feature bug fixes.
|
||||||
|
|
||||||
* `rbs` gem is bundled to load and process RBS files.
|
* `rbs` gem is bundled to load and process RBS files.
|
||||||
|
|
||||||
|
### TypeProf
|
||||||
|
|
||||||
|
* TypeProf is a type analysis tool for Ruby code based on abstract interpretation.
|
||||||
|
* It reads non-annotated Ruby code, tries inferring its type signature, and prints
|
||||||
|
the analysis result in RBS format.
|
||||||
|
* Though it supports only a subset of the Ruby language yet, we will continuously
|
||||||
|
improve the coverage of language features, the analysis performance, and usability.
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
# test.rb
|
||||||
|
def foo(x)
|
||||||
|
if x > 10
|
||||||
|
x.to_s
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
foo(42)
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
$ typeprof test.rb
|
||||||
|
# Classes
|
||||||
|
class Object
|
||||||
|
def foo : (Integer) -> String?
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
## Miscellaneous changes
|
## Miscellaneous changes
|
||||||
|
|
||||||
* Methods using `ruby2_keywords` will no longer keep empty keyword
|
* Methods using `ruby2_keywords` will no longer keep empty keyword
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue