diff --git a/stdlib/singleton/0/singleton.rbs b/stdlib/singleton/0/singleton.rbs index 6b368a8513..e6bb42d6f3 100644 --- a/stdlib/singleton/0/singleton.rbs +++ b/stdlib/singleton/0/singleton.rbs @@ -90,48 +90,26 @@ # p a.strip # => nil # module Singleton - def self.__init__: (Class klass) -> Class - - # - # Returns the singleton instance. - # - def self.instance: () -> instance - - # - # By default, do not retain any state when marshalling. + # + # The version string # - def _dump: (?Integer depth) -> String + VERSION: String - # - # Raises a TypeError to prevent cloning. - # - def clone: () -> bot + module SingletonInstanceMethods + def clone: () -> bot - # - # Raises a TypeError to prevent duping. - # - def dup: () -> bot + def dup: () -> bot - module SingletonInstanceMethods + def _dump: (?Integer depth) -> String end + include SingletonInstanceMethods module SingletonClassMethods + def instance: () -> instance end -end -# -# The version string -# -Singleton::VERSION: String + module SingletonClassProperties + def __init__: (Class klass) -> Class + end + extend SingletonClassProperties +end diff --git a/test/stdlib/singleton_test.rb b/test/stdlib/singleton_test.rb index 861f50fa7a..9901e6dadc 100644 --- a/test/stdlib/singleton_test.rb +++ b/test/stdlib/singleton_test.rb @@ -11,11 +11,6 @@ class TestClass include Singleton end - def test_instance - assert_send_type '() -> SingletonSingletonTest::TestClass', - TestClass, :instance - end - def test_singleton_instance_methods omit "SingletonInstanceMethods is not available" unless Singleton.const_defined?(:SingletonInstanceMethods, false)