mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Disallow R-assign in endless def
This commit is contained in:
parent
02ad393cd6
commit
1fe5bffefd
Notes:
git
2020-04-22 22:01:12 +09:00
1 changed files with 2 additions and 0 deletions
|
@ -1419,6 +1419,8 @@ eom
|
|||
assert_valid_syntax('private def inc(x) = x + 1')
|
||||
assert_valid_syntax('private def obj.foo = 42')
|
||||
assert_valid_syntax('private def obj.inc(x) = x + 1')
|
||||
eval('def self.inc(x) = x + 1 => @x')
|
||||
assert_equal(:inc, @x)
|
||||
end
|
||||
|
||||
def test_methoddef_in_cond
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue