Project

General

Profile

Actions

Bug #22619

closed

parse.y missing invalid return syntax error

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

Added by kddnewton (Kevin Newton) 8 days ago. Updated 2 days ago.

Status:
Closed
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>'

Updated by nobu (Nobuyoshi Nakada) 6 days ago Actions #1

  • Status changed from Open to Closed

Applied in changeset git|9b8cfe79f5608262e84543bd162c6419b40d1f4d.


[Bug #22619] Restore the "can't return" state

Updated by nobu (Nobuyoshi Nakada) 6 days ago Actions #2

  • Backport changed from 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN to 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED
Actions

Also available in: PDF Atom