class RuboCop::Cop::Lint::AmbiguousOperator
do_something(*array)
# With parentheses, there’s no ambiguity.
do_something *array
# a ‘*` method invocation (i.e. `do_something.*(array)`).
# The `*` is interpreted as a splat operator but it could possibly be
array = [1, 2, 3]
@example
method invocation without parentheses.
This cop checks for ambiguous operators in the first argument of a
def alternative_message(diagnostic)
def alternative_message(diagnostic) operator = diagnostic.location.source hash = AMBIGUITIES[operator] format(MSG_FORMAT, hash) end
def relevant_diagnostic?(diagnostic)
def relevant_diagnostic?(diagnostic) diagnostic.reason == :ambiguous_prefix end