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.5909 lib/types/generic.rb
sorbet-runtime-0.5.5903 lib/types/generic.rb
sorbet-runtime-0.5.5898 lib/types/generic.rb
sorbet-runtime-0.5.5895 lib/types/generic.rb
sorbet-runtime-0.5.5891 lib/types/generic.rb
sorbet-runtime-0.5.5890 lib/types/generic.rb
sorbet-runtime-0.5.5888 lib/types/generic.rb
sorbet-runtime-0.5.5883 lib/types/generic.rb
sorbet-runtime-0.5.5881 lib/types/generic.rb
sorbet-runtime-0.5.5880 lib/types/generic.rb
sorbet-runtime-0.5.5879 lib/types/generic.rb
sorbet-runtime-0.5.5878 lib/types/generic.rb
sorbet-runtime-0.5.5877 lib/types/generic.rb
sorbet-runtime-0.5.5873 lib/types/generic.rb
sorbet-runtime-0.5.5871 lib/types/generic.rb
sorbet-runtime-0.5.5870 lib/types/generic.rb
sorbet-runtime-0.5.5869 lib/types/generic.rb
sorbet-runtime-0.5.5868 lib/types/generic.rb
sorbet-runtime-0.5.5867 lib/types/generic.rb
sorbet-runtime-0.5.5866 lib/types/generic.rb