Issue #12389 has been reported by Jan Lelis.

----------------------------------------
Bug #12389: Module#constants includes non-constants
https://bugs.ruby-lang.org/issues/12389

* Author: Jan Lelis
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Hi Ruby Core,

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

```ruby
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



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>