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.5734 lib/types/generic.rb
sorbet-runtime-0.5.5730 lib/types/generic.rb
sorbet-runtime-0.5.5725 lib/types/generic.rb
sorbet-runtime-0.5.5716 lib/types/generic.rb
sorbet-runtime-0.5.5713 lib/types/generic.rb
sorbet-runtime-0.5.5703 lib/types/generic.rb
sorbet-runtime-0.5.5685 lib/types/generic.rb
sorbet-runtime-0.5.5676 lib/types/generic.rb
sorbet-runtime-0.5.5675 lib/types/generic.rb
sorbet-runtime-0.5.5669 lib/types/generic.rb
sorbet-runtime-0.5.5666 lib/types/generic.rb
sorbet-runtime-0.5.5657 lib/types/generic.rb
sorbet-runtime-0.5.5651 lib/types/generic.rb
sorbet-runtime-0.5.5648 lib/types/generic.rb
sorbet-runtime-0.5.5636 lib/types/generic.rb
sorbet-runtime-0.5.5631 lib/types/generic.rb
sorbet-runtime-0.5.5622 lib/types/generic.rb
sorbet-runtime-0.5.5610 lib/types/generic.rb
sorbet-runtime-0.5.5607 lib/types/generic.rb
sorbet-runtime-0.5.5605 lib/types/generic.rb