Project

General

Profile

Actions

Bug #22619

open

parse.y missing invalid return syntax error

Bug #22619: parse.y missing invalid return syntax error

Added by kddnewton (Kevin Newton) about 17 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:127664]

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

No data to display

Actions

Also available in: PDF Atom