Project

General

Profile

Actions

Feature #8839

open

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

Added by headius (Charles Nutter) over 10 years ago. Updated about 8 years ago.

Status:
Assigned
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 1 (0 open1 closed)

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0