[ruby-core:98502] [Ruby master Misc#16910] BasicObject is resolved in BasicObject
From:
fxn@...
Date:
2020-05-24 12:37:59 UTC
List:
ruby-core #98502
Issue #16910 has been updated by fxn (Xavier Noria). Ahhh, that explains it. That code says this is intentional and definitely not a bug. Thanks a lot Benoit! ---------------------------------------- Misc #16910: BasicObject is resolved in BasicObject https://bugs.ruby-lang.org/issues/16910#change-85778 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal ---------------------------------------- I categorized this as Misc because I do not really know if this is a bug, or perhaps I miss some special rule in the resolution of relative constants. Basically, I would expect ```ruby class C < BasicObject BasicObject end ``` or, even simpler, ```ruby class BasicObject BasicObject end ``` to raise `NameError`. Reason would be that top-level constants are stored in `Object`, which is not among the ancestors in any of the two examples above. Is my reasoning flawed or is it a bug? If flawed, which is the correct reasoning? -- 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>