Actions
Bug #12389
closedModule#constants includes non-constants
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
Backport:
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
Updated by nobu (Nobuyoshi Nakada) over 8 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) 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
Like0
Like0Like0Like0Like0