Skip to content

Commit

Permalink
stop hacking T::Generic to test if that makes a difference
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrias committed Sep 10, 2024
1 parent 0656952 commit 080e224
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/runtime_generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ module RuntimeGeneric
extend T::Sig
include T::Generic

def type_member(variance = :invariant, &blk)
# `T::Generic#type_member` just instantiates a `T::Type::TypeMember` instance and returns it.
# We use that when registering the type member and then later return it from this method.
#
# Dear developer, This part was adapted from tapioca so it can keep
# generating proper RBIs for this ad-hoc generics, Genar
Tapioca::TypeVariableModule.new(
T.cast(self, Module),
Tapioca::TypeVariableModule::Type::Member,
variance,
blk
).tap do |type_variable|
Tapioca::Runtime::GenericTypeRegistry.register_type_variable(self, type_variable)
end
end
# def type_member(variance = :invariant, &blk)
# # `T::Generic#type_member` just instantiates a `T::Type::TypeMember` instance and returns it.
# # We use that when registering the type member and then later return it from this method.
# #
# # Dear developer, This part was adapted from tapioca so it can keep
# # generating proper RBIs for this ad-hoc generics, Genar
# Tapioca::TypeVariableModule.new(
# T.cast(self, Module),
# Tapioca::TypeVariableModule::Type::Member,
# variance,
# blk
# ).tap do |type_variable|
# Tapioca::Runtime::GenericTypeRegistry.register_type_variable(self, type_variable)
# end
# end
end

0 comments on commit 080e224

Please sign in to comment.