[ruby-core:96363] [Ruby master Bug#16438] Check warning messages for Ruby 2.7
From:
manga.osyo@...
Date:
2019-12-20 02:56:05 UTC
List:
ruby-core #96363
Issue #16438 has been updated by osyo (manga osyo).
> pls check current master.
Sorry, became warning.
----------------------------------------
Bug #16438: Check warning messages for Ruby 2.7
https://bugs.ruby-lang.org/issues/16438#change-83273
* Author: ko1 (Koichi Sasada)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 2.7
* ruby -v:
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Please check Ruby 2.7 new introduced warning messages.
* deprecation warning
```ruby
def foo(**kw)
end
foo({}) #=> test.rb:4: warning: The last argument is used as the keyword parameter
# test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call?
# deafult: on
```
```ruby
_1 = 2
#=>
# t.rb:1: warning: `_1' is used as numbered parameter
# default: on
```
```ruby
def _1; end
#=> test.rb:1: warning: `_1' is used as numbered parameter
# deafult: on
# added at Today!!
```
```ruby
def foo
proc.call #=> 1
end
foo{p 1}
#=>
# t.rb:2: warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
# 1
# default: on
```
```ruby
$; = //
#=> t.rb:1: warning: non-nil $; will be deprecated
$, = ''
#=> t.rb:2: warning: non-nil $, will be deprecated
# default: on
```
```ruby
def foo
class << Object.new
yield
end
end
foo { p :ok } #=> warning: `yield' in class syntax will not be supported from Ruby 3.0.
# default: on
```
```ruby
require 'open-uri'
open('http://atdot.net')
#=> test.rb:2: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
# default: on
```
* experimental feature
```
$ ./miniruby -e 'case 1; in 1; end'
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
# default: on
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>