Sha256: 3bc6b8d7f2714a6bb30c1232067849235b8cc5940783d75f09bfa561a93909e7

Contents?: true

Size: 683 Bytes

Versions: 401

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true
# typed: true

# Use as a mixin with extend (`extend T::Generic`).
# Docs at https://hackpad.corp.stripe.com/Type-Validation-in-pay-server-1JaoTHir5Mo.
module T::Generic
  include T::Helpers
  include Kernel

  ### Class/Module Helpers ###

  def [](*types)
    self
  end

  def type_member(variance=:invariant, fixed: nil, lower: T.untyped, upper: BasicObject)
    T::Types::TypeMember.new(variance) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
  end

  def type_template(variance=:invariant, fixed: nil, lower: T.untyped, upper: BasicObject)
    T::Types::TypeTemplate.new(variance) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
  end
end

Version data entries

401 entries across 401 versions & 1 rubygems

Version Path
sorbet-runtime-0.5.5809 lib/types/generic.rb
sorbet-runtime-0.5.5808 lib/types/generic.rb
sorbet-runtime-0.5.5803 lib/types/generic.rb
sorbet-runtime-0.5.5796 lib/types/generic.rb
sorbet-runtime-0.5.5795 lib/types/generic.rb
sorbet-runtime-0.5.5794 lib/types/generic.rb
sorbet-runtime-0.5.5790 lib/types/generic.rb
sorbet-runtime-0.5.5786 lib/types/generic.rb
sorbet-runtime-0.5.5784 lib/types/generic.rb
sorbet-runtime-0.5.5781 lib/types/generic.rb
sorbet-runtime-0.5.5779 lib/types/generic.rb
sorbet-runtime-0.5.5777 lib/types/generic.rb
sorbet-runtime-0.5.5772 lib/types/generic.rb
sorbet-runtime-0.5.5767 lib/types/generic.rb
sorbet-runtime-0.5.5765 lib/types/generic.rb
sorbet-runtime-0.5.5756 lib/types/generic.rb
sorbet-runtime-0.5.5753 lib/types/generic.rb
sorbet-runtime-0.5.5745 lib/types/generic.rb
sorbet-runtime-0.5.5742 lib/types/generic.rb
sorbet-runtime-0.5.5737 lib/types/generic.rb