1
0
Fork 0
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:
Nobuyoshi Nakada 2020-04-22 18:56:06 +09:00
parent 02ad393cd6
commit 1fe5bffefd
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2020-04-22 22:01:12 +09:00

View file

@ -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