Sha256: 6855c302599df30717aa403ee4c9e78fa4c4a62fe0f06a41850cc8d06b5381b8

Contents?: true

Size: 927 Bytes

Versions: 44

Compression:

Stored size: 927 Bytes

Contents

module RBS
  class VarianceCalculator
    type variance = :unused | :covariant | :contravariant | :invariant

    class Result
      attr_reader result: Hash[Symbol, variance]

      def initialize: (variables: Array[Symbol]) -> void

      def covariant: (Symbol) -> void

      def contravariant: (Symbol) -> void

      def invariant: (Symbol) -> void

      def each: () { ([Symbol, variance]) -> void } -> void

      def include?: (Symbol) -> bool

      def compatible?: (Symbol, with_annotation: variance) -> bool
    end

    attr_reader builder: DefinitionBuilder

    def initialize: (builder: DefinitionBuilder) -> void

    def env: () -> Environment

    def in_method_type: (method_type: MethodType, variables: Array[Symbol]) -> Result

    def in_inherit: (name: TypeName, args: Array[Types::t], variables: Array[Symbol]) -> Result

    def type: (Types::t, result: Result, context: variance) -> void
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
rbs-0.13.0 sig/variance_calculator.rbs
rbs-0.12.2 sig/variance_calculator.rbs
rbs-0.12.1 sig/variance_calculator.rbs
rbs-0.12.0 sig/variance_calculator.rbs