diff --git a/lib/tapioca/runtime/reflection.rb b/lib/tapioca/runtime/reflection.rb index 2c421039f..b32386e9a 100644 --- a/lib/tapioca/runtime/reflection.rb +++ b/lib/tapioca/runtime/reflection.rb @@ -21,7 +21,6 @@ module Reflection CLASS_METHOD = Kernel.instance_method(:class) #: UnboundMethod CONSTANTS_METHOD = Module.instance_method(:constants) #: UnboundMethod NAME_METHOD = Module.instance_method(:name) #: UnboundMethod - SINGLETON_CLASS_METHOD = Object.instance_method(:singleton_class) #: UnboundMethod ANCESTORS_METHOD = Module.instance_method(:ancestors) #: UnboundMethod SUPERCLASS_METHOD = Class.instance_method(:superclass) #: UnboundMethod OBJECT_ID_METHOD = BasicObject.instance_method(:__id__) #: UnboundMethod @@ -66,7 +65,9 @@ def name_of(constant) #: (T::Module[top] constant) -> Class[top] def singleton_class_of(constant) - SINGLETON_CLASS_METHOD.bind_call(constant) + class << constant + self + end end #: (T::Module[top] constant) -> Array[T::Module[top]]