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:
parent
ffb49a7e9b
commit
e7606de949
2 changed files with 5 additions and 1 deletions
2
parse.y
2
parse.y
|
@ -2487,7 +2487,7 @@ primary : literal
|
|||
| tLPAREN_ARG {SET_LEX_STATE(EXPR_ENDARG);} rparen
|
||||
{
|
||||
/*%%%*/
|
||||
$$ = 0;
|
||||
$$ = NEW_BEGIN(0);
|
||||
/*%
|
||||
$$ = dispatch1(paren, 0);
|
||||
%*/
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue