Skip to content

Commit

Permalink
different approach to make runtime generic compatible with tapioca
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrias committed Sep 10, 2024
1 parent f53cdfc commit fb48262
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/runtime_generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ module RuntimeGeneric
extend T::Sig
include T::Generic

def self.extended(base)
base.extend(T::Generic)
end

class TypedGeneric < T::Types::Simple
extend T::Sig

Expand Down Expand Up @@ -41,9 +45,11 @@ def inner_type

def [](inner_type)
RuntimeGeneric::TypedGeneric.new(self, inner_type)
super
end

def type_member(variance = :invariant, &blk)
MyTypeMember.new(variance, &blk)
super
end
end

0 comments on commit fb48262

Please sign in to comment.