mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Rightward assignment is replaced by one-line pattern matching
This commit is contained in:
parent
c3e2dd072a
commit
700637570f
2 changed files with 0 additions and 17 deletions
7
NEWS.md
7
NEWS.md
|
@ -82,13 +82,6 @@ sufficient information, see the ChangeLog file or Redmine
|
|||
class variable from the toplevel scope is now a RuntimeError.
|
||||
[[Bug #14541]]
|
||||
|
||||
* Rightward assignment statement is added. [EXPERIMENTAL]
|
||||
[[Feature #15921]]
|
||||
|
||||
```ruby
|
||||
fib(10) => x
|
||||
```
|
||||
|
||||
* Endless method definition is added. [EXPERIMENTAL]
|
||||
[[Feature #16746]]
|
||||
|
||||
|
|
|
@ -1712,16 +1712,6 @@ eom
|
|||
assert_equal [[4, 1, 5, 2, 3], {a: 1}], obj.foo(4, 5, 2, 3, a: 1){|args, kws| [args, kws]}
|
||||
end
|
||||
|
||||
def test_rightward_assign
|
||||
a = b = nil
|
||||
EnvUtil.suppress_warning {eval("1 => a")}
|
||||
assert_equal(1, a)
|
||||
EnvUtil.suppress_warning {eval("13.divmod(5) => [a,b]")}
|
||||
assert_equal([2,3], [a, b])
|
||||
EnvUtil.suppress_warning {eval("1+2 => a")}
|
||||
assert_equal(3, a)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def not_label(x) @result = x; @not_label ||= nil end
|
||||
|
|
Loading…
Reference in a new issue