Project

General

Profile

Feature #8839

Class and module should return the class or module that was opened

Added by headius (Charles Nutter) over 6 years ago. Updated over 4 years ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:56890]

Description

With the change for https://bugs.ruby-lang.org/issues/3753, "def" forms now return the symbolic name of the method defined. Because class and module bodies just return the last expression in their bodies, this means they will now usually end up returning a symbol for the last method defined. This does not seem useful or correct.

I think class and module should return a reference to the class or module just opened. This would make the return value useful and consistent.


Related issues

Related to Ruby master - Feature #11905: Change the 'class' keyword to return a symbolClosedActions

Also available in: Atom PDF