зеркало из https://github.com/github/ruby.git
NEWS: Add an example for the warning of "yield in singleton class"
This commit is contained in:
Родитель
f09fc1b034
Коммит
373769c939
7
NEWS
7
NEWS
|
@ -188,6 +188,13 @@ sufficient information, see the ChangeLog file or Redmine
|
|||
|
||||
* +yield+ in singleton class syntax is warned and will be deprecated later [Feature #15575].
|
||||
|
||||
def foo
|
||||
class << Object.new
|
||||
yield
|
||||
end
|
||||
end
|
||||
foo { p :ok } #=> warning: `yield' in class syntax will not be supported from Ruby 3.0.
|
||||
|
||||
* Argument forwarding by <code>(...)</code> is introduced. [Feature #16253]
|
||||
|
||||
def foo(...)
|
||||
|
|
Загрузка…
Ссылка в новой задаче