Generic RuboCop::AST::Node for stanza method nodes
- These can be either BlockNode, SendNode or AsgnNode, which are all a type of Node. - This causes errors in other places because we call BlockNode or SendNode methods on a Node now. Still TODO.
This commit is contained in:
parent
9a97456767
commit
06441f1337
@ -14,16 +14,16 @@ module RuboCop
|
||||
|
||||
sig {
|
||||
params(
|
||||
method_node: T.any(RuboCop::AST::SendNode, RuboCop::AST::BlockNode),
|
||||
method_node: RuboCop::AST::Node,
|
||||
all_comments: T::Array[T.any(String, Parser::Source::Comment)],
|
||||
).void
|
||||
}
|
||||
def initialize(method_node, all_comments)
|
||||
@method_node = T.let(method_node, T.any(RuboCop::AST::SendNode, RuboCop::AST::BlockNode))
|
||||
@method_node = T.let(method_node, RuboCop::AST::Node)
|
||||
@all_comments = T.let(all_comments, T::Array[T.any(String, Parser::Source::Comment)])
|
||||
end
|
||||
|
||||
sig { returns(T.any(RuboCop::AST::SendNode, RuboCop::AST::BlockNode)) }
|
||||
sig { returns(RuboCop::AST::Node) }
|
||||
attr_reader :method_node
|
||||
alias stanza_node method_node
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ module RuboCop
|
||||
class Discontinued < Base
|
||||
sig {
|
||||
params(
|
||||
base_node: T.any(RuboCop::AST::BlockNode, RuboCop::AST::SendNode),
|
||||
base_node: RuboCop::AST::Node,
|
||||
block: T.nilable(T.proc.params(node: RuboCop::AST::SendNode).void),
|
||||
).returns(T::Boolean)
|
||||
}
|
||||
@ -14,7 +14,7 @@ module RuboCop
|
||||
|
||||
sig {
|
||||
params(
|
||||
base_node: T.any(RuboCop::AST::BlockNode, RuboCop::AST::SendNode),
|
||||
base_node: RuboCop::AST::Node,
|
||||
block: T.proc.params(node: RuboCop::AST::SendNode).void,
|
||||
).void
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user