Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Feb 25, 2025
1 parent 696e202 commit f64819f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions sig/steep/ast/types/tuple.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ module Steep
def map_type: () { (t) -> t } -> Tuple

def level: () -> Array[Integer]

def with_location: (untyped) -> Tuple
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions sig/steep/ast/types/union.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module Steep
include Helper::ChildrenLevel

def level: () -> Array[Integer]

def with_location: (untyped) -> Tuple
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions sig/steep/diagnostic/ruby.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,11 @@ module Steep
# ```
#
class DifferentMethodParameterKind < Base
attr_reader method_param: TypeInference::MethodParams::PositionalParameter | TypeInference::MethodParams::KeywordParameter
attr_reader method_param: TypeInference::MethodParams::PositionalParameter | TypeInference::MethodParams::PositionalRestParameter | TypeInference::MethodParams::KeywordParameter | TypeInference::MethodParams::KeywordRestParameter

attr_reader method_type: Interface::MethodType

def initialize: (method_param: TypeInference::MethodParams::PositionalParameter | TypeInference::MethodParams::KeywordParameter, method_type: Interface::MethodType) -> void
def initialize: (method_param: TypeInference::MethodParams::PositionalParameter | TypeInference::MethodParams::PositionalRestParameter | TypeInference::MethodParams::KeywordParameter | TypeInference::MethodParams::KeywordRestParameter, method_type: Interface::MethodType) -> void

def header_line: () -> String
end
Expand Down Expand Up @@ -1403,7 +1403,7 @@ module Steep
# The syntax is not currently supported by Steep.
#
class UnsupportedSyntax < Base
attr_reader message: String
attr_reader message: String?

def initialize: (node: Node, ?message: String?) -> void

Expand Down Expand Up @@ -1760,8 +1760,8 @@ module Steep
# end
# ```
#
def initialize: (node: Parser::AST::Node, method_name: Symbol, params_pair: [Interface::Function::Params, Interface::Function::Params], result: Subtyping::Result::Base) -> void
| (node: Parser::AST::Node, method_name: Symbol, block_pair: [Interface::Block?, Interface::Block?], result: Subtyping::Result::Base) -> void
def initialize: (node: Parser::AST::Node, method_name: Symbol, params_pair: [Interface::Function::Params, Interface::Function::Params], result: Subtyping::Result::t) -> void
| (node: Parser::AST::Node, method_name: Symbol, block_pair: [Interface::Block?, Interface::Block?], result: Subtyping::Result::t) -> void

def header_line: () -> String
end
Expand Down
2 changes: 1 addition & 1 deletion sig/steep/type_construction.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module Steep
# end
# ```
#
def no_subtyping?: (sub_type: AST::Types::t, super_type: AST::Types::t, ?constraints: Subtyping::Constraints) -> Subtyping::Result::Base?
def no_subtyping?: (sub_type: AST::Types::t, super_type: AST::Types::t, ?constraints: Subtyping::Constraints) -> Subtyping::Result::t?

def for_new_method: (Symbol method_name, Parser::AST::Node node, args: Array[Parser::AST::Node], self_type: untyped, definition: RBS::Definition?) -> TypeConstruction

Expand Down
4 changes: 2 additions & 2 deletions sig/steep/type_inference/context.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ module Steep
attr_reader super_method: RBS::Definition::Method?

# The type of forwarding params when `...` is given
attr_reader forward_arg_type: [Params, Block?]?
attr_reader forward_arg_type: [Params, Block?] | true | nil

def initialize: (
name: Symbol,
method: RBS::Definition::Method?,
method_type: Interface::MethodType?,
return_type: AST::Types::t,
super_method: RBS::Definition::Method?,
forward_arg_type: [Params, Block?]?
forward_arg_type: [Params, Block?] | true | nil
) -> void

# Type of the block of the current method type
Expand Down
2 changes: 2 additions & 0 deletions sig/steep/typing.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ module Steep

def call_of: (node: Parser::AST::Node) -> TypeInference::MethodCall::t

def block_range: (Parser::AST::Node node) -> Range[Integer]

def dump: (untyped io) -> untyped

def self.summary: (untyped node) -> ::String
Expand Down

0 comments on commit f64819f

Please sign in to comment.