Sha256: c9e17ea617d2ccfc0d3cc26e40a031f8b8efbe7bb71ac5f73ae1647a672dba6d

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

module RBS
  class MethodType
    # () -> void
    # ^^^^^^^^^^     type
    #
    # [A] () { () -> A } -> A
    # ^^^                      type_params
    #     ^^^^^^^^^^^^^^^^^^^  type
    #
    type loc = Location[:type, :type_params]

    attr_reader type_params: Array[AST::TypeParam]
    attr_reader type: Types::Function
    attr_reader block: Types::Block?
    attr_reader location: loc?

    def initialize: (type_params: Array[AST::TypeParam], type: Types::Function, block: Types::Block?, location: loc?) -> void

    def ==: (untyped other) -> bool

    include _ToJson

    # Substitute type variables to some types.
    # Takes care of type parameter bounds.
    #
    def sub: (Substitution) -> MethodType

    def update: (?type_params: Array[AST::TypeParam], ?type: Types::Function, ?block: Types::Block?, ?location: loc?) -> MethodType

    def free_variables: (?Set[Symbol] set) -> Set[Symbol]

    # Apply the mapping included in the MethodType.
    #
    # Note that type bound in generics parameter is not handled by this method.
    # You may want to use `#map_type_bound` explicitly, or `#sub` for simple substitution.
    #
    def map_type: () { (Types::t) -> Types::t } -> MethodType

    def map_type_bound: () { (AST::TypeParam::bound) -> AST::TypeParam::bound } -> MethodType

    def each_type: () { (Types::t) -> void } -> void
                 | () -> Enumerator[Types::t, void]

    def to_s: () -> String

    def type_param_names: () -> Array[Symbol]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbs-2.0.0 sig/method_types.rbs
rbs-2.0.0.pre2 sig/method_types.rbs
rbs-2.0.0.pre1 sig/method_types.rbs