From: "jeremyevans0 (Jeremy Evans)" Date: 2022-06-20T23:59:57+00:00 Subject: [ruby-core:109026] [Ruby master Feature#18832] Do not have class/module keywords consider ancestors of Object Issue #18832 has been updated by jeremyevans0 (Jeremy Evans). Backport deleted (2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN) Subject changed from Suspicious superclass mismatch to Do not have class/module keywords consider ancestors of Object Tracker changed from Bug to Feature As I initially expected, this is not a bug. Having class/module keywords consider ancestors of Object is by design, with explicit code for just this purpose, and there is both a test and spec for the current behavior. Switching to feature request. That being said, I do think it would be best to change the behavior, so I submitted a pull request to do so: https://github.com/ruby/ruby/pull/6048 . I'll add this as a topic for the next developer meeting. ---------------------------------------- Feature #18832: Do not have class/module keywords consider ancestors of Object https://bugs.ruby-lang.org/issues/18832#change-98141 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal ---------------------------------------- The following code: ```ruby module M class C end end include M p Object.const_defined?(:C, false) class C < String # (1) end ``` prints `false`, as expected, but then raises `superclass mismatch for class C (TypeError)` at (1). I believe this is a bug, because `Object` itself does not have a `C` constant, so (1) should just work, and the superclasse of `M::C` should be irrelevant. -- https://bugs.ruby-lang.org/ Unsubscribe: