From c167d68f9ccf6fdcc22f5aba49bc2b2f438b812d Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Fri, 12 Apr 2024 11:20:04 +0100 Subject: [PATCH] redefine superclass in Object as always returning a class the only instance of a nil superclass is basic object --- core/basic_object.rbs | 2 ++ core/class.rbs | 2 +- core/object.rbs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/basic_object.rbs b/core/basic_object.rbs index 3126e2b88..5302fb44f 100644 --- a/core/basic_object.rbs +++ b/core/basic_object.rbs @@ -369,4 +369,6 @@ class BasicObject # Undefining one # def singleton_method_undefined: (Symbol name) -> nil + + def self.superclass -> nil end diff --git a/core/class.rbs b/core/class.rbs index abfdc2164..fb2d1e1fe 100644 --- a/core/class.rbs +++ b/core/class.rbs @@ -216,5 +216,5 @@ class Class < Module # # BasicObject.superclass #=> nil # - def superclass: () -> Class? + # def superclass: () -> Class? end diff --git a/core/object.rbs b/core/object.rbs index 2fee491f4..1f3f61b83 100644 --- a/core/object.rbs +++ b/core/object.rbs @@ -107,6 +107,8 @@ # class Object < BasicObject include Kernel + + def self.superclass() -> Class end # A previous incarnation of `interned` for backward-compatibility (see #1499)