From: "Eregon (Benoit Daloze)" Date: 2022-03-11T12:18:59+00:00 Subject: [ruby-core:107845] [Ruby master Bug#11063] Special singleton class should return true for singleton_class? test Issue #11063 has been updated by Eregon (Benoit Daloze). Changing this would cause the reverse inconsistency: ```ruby false.class.singleton_class? #=> would be true, but .class.singleton_class? should always be false ``` The only real fix would be to have separate class and singleton_class for nil/false/true, but it's unclear if that's worth it. ---------------------------------------- Bug #11063: Special singleton class should return true for singleton_class? test https://bugs.ruby-lang.org/issues/11063#change-96782 * Author: rbjl (Jan Lelis) * Status: Open * Priority: Normal * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- This seems wrong (or at least inconsistent): ~~~ nil.singleton_class.singleton_class? #=> false true.singleton_class.singleton_class? #=> false false.singleton_class.singleton_class? #=> false ~~~ ---Files-------------------------------- special_singletons.patch (1.16 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: