From 700637570ff63c0fa3b2373b6e5d7053b5fc35a2 Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Wed, 4 Nov 2020 00:51:44 +0900 Subject: [PATCH] Rightward assignment is replaced by one-line pattern matching --- NEWS.md | 7 ------- test/ruby/test_syntax.rb | 10 ---------- 2 files changed, 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8c6e353ae5..495a633102 100644 --- a/NEWS.md +++ b/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]] diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 9f8c4600c6..73c15f8a7f 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -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