Sha256: 75f81e2df259db4dccb2c1235c9396c055e1971157b0e961aa4c6aaff8ad8113

Contents?: true

Size: 1.66 KB

Versions: 7

Compression:

Stored size: 1.66 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]

    def has_self_type?: () -> bool

    def has_classish_type?: () -> bool

    def with_nonreturn_void?: () -> bool
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rbs-3.5.3 sig/method_types.rbs
rbs-3.5.2 sig/method_types.rbs
rbs-3.5.1 sig/method_types.rbs
rbs-3.5.1.pre.1 sig/method_types.rbs
rbs-3.5.0 sig/method_types.rbs
rbs-3.5.0.pre.2 sig/method_types.rbs
rbs-3.5.0.pre.1 sig/method_types.rbs