Project

General

Profile

Bug #12389

Module#constants includes non-constants

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

Status:
Closed
Priority:
Normal
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

Associated revisions

Revision c57c719e
Added by nobu (Nobuyoshi Nakada) about 3 years ago

variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55182
Added by nobu (Nobuyoshi Nakada) about 3 years ago

variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

Revision 55182
Added by nobu (Nobuyoshi Nakada) about 3 years ago

variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

Revision 55182
Added by nobu (Nobuyoshi Nakada) about 3 years ago

variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

Revision 55182
Added by nobu (Nobuyoshi Nakada) about 3 years ago

variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

Revision bcd3f786
Added by usa (Usaku NAKAMURA) about 3 years ago

merge revision(s) 55182: [Backport #12389]

    * variable.c (rb_local_constants_i): exclude hidden constants.
      [ruby-core:75575] [Bug #12389]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55356
Added by usa (Usaku NAKAMURA) about 3 years ago

merge revision(s) 55182: [Backport #12389]

* variable.c (rb_local_constants_i): exclude hidden constants.
  [ruby-core:75575] [Bug #12389]

Revision f8cccade
Added by nagachika (Tomoyuki Chikanaga) about 3 years ago

merge revision(s) 55182: [Backport #12389]

    * variable.c (rb_local_constants_i): exclude hidden constants.
      [ruby-core:75575] [Bug #12389]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55403
Added by nagachika (Tomoyuki Chikanaga) about 3 years ago

merge revision(s) 55182: [Backport #12389]

* variable.c (rb_local_constants_i): exclude hidden constants.
  [ruby-core:75575] [Bug #12389]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Status changed from Open to Closed

Applied in changeset r55182.


variable.c: hidden constants

  • variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389]

Updated by nagachika (Tomoyuki Chikanaga) about 3 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) about 3 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) about 3 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.

Also available in: Atom PDF