Project

General

Profile

Actions

Bug #12389

closed

Module#constants includes non-constants

Added by rbjl (Jan Lelis) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[ruby-core:75575]

Description

Hi Ruby Core,

I noticed that Module#constants(false) sometimes includes modules/classes with a lowercase name:

Complex.constants # => [:I]
Complex.constants(false) # => [:compatible, :I]
Complex.const_defined? :compatible # NameError: wrong constant name compatible

NameError.constants # => []
NameError.constants(false) # => [:message]

Also:

  • Rational --> compatible
  • IO --> generic_readable
  • IO --> generic_writable
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

  • Status changed from Open to Closed

Applied in changeset r55182.


variable.c: hidden constants

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: DONE, 2.3: REQUIRED

ruby_2_2 r55356 merged revision(s) 55182.

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: DONE, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: DONE, 2.3: DONE

ruby_2_3 r55403 merged revision(s) 55182.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0