1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: primary should not be 0

* parse.y (primary): should not be 0, since it can be a receiver.
  [ruby-core:82447] [Bug #13836]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-08-22 13:21:18 +00:00
parent ffb49a7e9b
commit e7606de949
2 changed files with 5 additions and 1 deletions

View file

@ -2487,7 +2487,7 @@ primary : literal
| tLPAREN_ARG {SET_LEX_STATE(EXPR_ENDARG);} rparen
{
/*%%%*/
$$ = 0;
$$ = NEW_BEGIN(0);
/*%
$$ = dispatch1(paren, 0);
%*/

View file

@ -99,6 +99,10 @@ class TestDefined < Test::Unit::TestCase
end
end
def test_defined_empty_paren_arg
assert_nil(defined?(p () + 1))
end
def test_defined_impl_specific
feature7035 = '[ruby-core:47558]' # not spec
assert_predicate(defined?(Foo), :frozen?, feature7035)