Skip to content

Commit c9957e4

Browse files
authored
Merge pull request #3037 from infiton/rxc/declare-singleton-instance-methods
Declare Singleton::SingletonInstanceMethods
2 parents 1f40487 + 0d52206 commit c9957e4

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

stdlib/singleton/0/singleton.rbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ module Singleton
124124
#
125125
def dup: () -> bot
126126

127+
module SingletonInstanceMethods
128+
end
129+
127130
module SingletonClassMethods
128131
end
129132
end

test/stdlib/singleton_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ def test_instance
1515
assert_send_type '() -> SingletonSingletonTest::TestClass',
1616
TestClass, :instance
1717
end
18+
19+
def test_singleton_instance_methods
20+
omit "SingletonInstanceMethods is not available" unless Singleton.const_defined?(:SingletonInstanceMethods, false)
21+
22+
assert_const_type "Module", "Singleton::SingletonInstanceMethods"
23+
end
1824
end

0 commit comments

Comments
 (0)