[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>
Issue #18888 has been reported by shugo (Shugo Maeda).
16 messages
2022/06/30
[ruby-core:108981] [Ruby master Bug#18832] Suspicious superclass mismatch
From:
"Eregon (Benoit Daloze)" <noreply@...>
Date:
2022-06-17 10:45:24 UTC
List:
ruby-core #108981
Issue #18832 has been updated by Eregon (Benoit Daloze). Yes, I think that's a great example why we should fix this. Anyone should still be able to define a `Comment` (defined as a constant of `Object`) class with just `class Comment` at the top-level, even if with `REXML::Comment` + `include REXML`. BTW, I thought `class Object::Comment < String; end` might be a workaround but it does not (as Jeremy found out as well above): ```ruby $ ruby -v -rrexml -e 'include REXML; class Object::Comment < String; end' ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux] -e:1:in `<main>': superclass mismatch for class Comment (TypeError) ``` This is also very surprising (the intention is to define `Object::Comment` with a superclass of `Object`): ```ruby $ ruby -v -rrexml -e 'include REXML; class Comment; end; p Comment.ancestors' ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux] [REXML::Comment, Comparable, REXML::Child, REXML::Node, Object, REXML, PP::ObjectMixin, Kernel, BasicObject] ``` ---------------------------------------- Bug #18832: Suspicious superclass mismatch https://bugs.ruby-lang.org/issues/18832#change-98086 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- 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: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>