From 45f6cdcdd3d11de1bf7691f732bc967880b4caad Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 14 May 2012 07:28:36 +0000 Subject: Bug #6403: reset states after empty args * parse.y (f_arglist): should reset lexical states after empty argument list with no parenthesis as well as parenthesized list, so that reserved name method definition work. [ruby-dev:45626] [Bug #6403] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index b792858090..7eef6d6066 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -176,6 +176,11 @@ class TestSyntax < Test::Unit::TestCase assert_valid_syntax("p begin 1.times do 1 end end", __FILE__, bug6419) end + def test_reserved_method_no_args + bug6403 = '[ruby-dev:45626]' + assert_valid_syntax("def self; :foo; end", __FILE__, bug6403) + end + private def not_label(x) @result = x; @not_label ||= nil end -- cgit v1.2.3