1
0
Fork 0
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:
Kazuki Tsujimoto 2020-11-04 00:51:44 +09:00
parent c3e2dd072a
commit 700637570f
No known key found for this signature in database
GPG key ID: BCEA306C49B81CD7
2 changed files with 0 additions and 17 deletions

View file

@ -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]]

View file

@ -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