Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/tapioca/runtime/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]]
Expand Down
Loading