Project

General

Profile

Actions

Bug #20647

closed

Invalid return in class/module body from within singleton class

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

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:118670]

Description

Currently, Ruby will raise a syntax error for invalid returns within class and module bodies, but skips it for singleton classes. I think we should be able to add this same error for singleton classes, as I believe these always raise a LocalJumpError.

class << Object
  return
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0