Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update types #1505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess using Result::t is better than Result::Base. Is this correct?


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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems forward_arg_type should take a true value, right?

) -> 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