Sha256: 6371d72385ca0273d6b0b72d0c07e318c740f1377ec5ac1b1935da9667232904

Contents?: true

Size: 1.55 KB

Versions: 38

Compression:

Stored size: 1.55 KB

Contents

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

    type attr_loc = AST::Members::Attribute::loc

    type loc = def_loc | attr_loc

    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

38 entries across 38 versions & 2 rubygems

Version Path
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/sig/method_types.rbs
rbs-3.2.2 sig/method_types.rbs
rbs-3.2.1 sig/method_types.rbs
rbs-3.2.0 sig/method_types.rbs
rbs-3.2.0.pre.1 sig/method_types.rbs
rbs-3.1.3 sig/method_types.rbs
rbs-3.1.2 sig/method_types.rbs
rbs-3.1.1 sig/method_types.rbs
rbs-3.1.0 sig/method_types.rbs
rbs-3.0.4 sig/method_types.rbs
rbs-3.0.3 sig/method_types.rbs
rbs-3.0.2 sig/method_types.rbs
rbs-3.0.1 sig/method_types.rbs
rbs-3.0.0 sig/method_types.rbs
rbs-3.0.0.dev.3 sig/method_types.rbs
rbs-3.0.0.dev.2 sig/method_types.rbs
rbs-2.8.4 sig/method_types.rbs
rbs-2.8.3 sig/method_types.rbs
rbs-3.0.0.dev.1 sig/method_types.rbs
rbs-2.8.2 sig/method_types.rbs