Bug #22619
closed
parse.y missing invalid return syntax error
Added by kddnewton (Kevin Newton) 8 days ago.
Updated 2 days ago.
Description
$ ./ruby --parser=parse.y -ce 'class C; return; end'
-e:1: Invalid return in class/module body
class C; return; end
./ruby: compile error (SyntaxError)
$ ./ruby --parser=parse.y -ce 'class C; def f; end; return; end'
Syntax OK
and
$ ./ruby --parser=parse.y -e 'class C; return; end'
-e:1: Invalid return in class/module body
class C; return; end
./ruby: compile error (SyntaxError)
$ ./ruby --parser=parse.y -e 'class C; def f; end; return; end'
-e:1:in '<class:C>': unexpected return (LocalJumpError)
from -e:1:in '<main>'
- Status changed from Open to Closed
- Backport changed from 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED
Also available in: PDF
Atom