diff options
author | Kazuki Tsujimoto <kazuki@callcc.net> | 2020-11-04 00:51:44 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <kazuki@callcc.net> | 2020-11-04 00:51:44 +0900 |
commit | 700637570ff63c0fa3b2373b6e5d7053b5fc35a2 (patch) | |
tree | 906970c211f1efc549a620ac4849d6195061635b | |
parent | c3e2dd072aa46be3d13faff9a5fed0ba64b2b680 (diff) |
Rightward assignment is replaced by one-line pattern matching
-rw-r--r-- | NEWS.md | 7 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 10 |
2 files changed, 0 insertions, 17 deletions
@@ -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 |