You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The match method takes an argument of either a regex or a string. However, when we run auto correct, do_something if "foo.txt".match(".txt")
gets autocorrected to do_something if "foo.txt" =~ ".txt", which results in TypeError: type mismatch: String given
Expected behavior
match() should only be autocorrected to =~ if the argument is a regex.
Actual behavior
When running autocorrect do_something if "foo.txt".match(".txt") gets autocorrected to do_something if "foo.txt" =~ ".txt".
RuboCop version
0.40.0
The text was updated successfully, but these errors were encountered:
#3352)
The match method takes an argument of either a regex or a string. However, when we run auto correct,
do_something if "foo.txt".match(".txt") gets autocorrected to
do_something if "foo.txt" =~ ".txt", which results in TypeError: type mismatch: String given
Neodelf
pushed a commit
to Neodelf/rubocop
that referenced
this issue
Oct 15, 2016
…ch` cop. (rubocop#3352)
The match method takes an argument of either a regex or a string. However, when we run auto correct,
do_something if "foo.txt".match(".txt") gets autocorrected to
do_something if "foo.txt" =~ ".txt", which results in TypeError: type mismatch: String given
The
match
method takes an argument of either a regex or a string. However, when we run auto correct,do_something if "foo.txt".match(".txt")
gets autocorrected to
do_something if "foo.txt" =~ ".txt"
, which results inTypeError: type mismatch: String given
Expected behavior
match()
should only be autocorrected to=~
if the argument is a regex.Actual behavior
When running autocorrect
do_something if "foo.txt".match(".txt")
gets autocorrected todo_something if "foo.txt" =~ ".txt"
.RuboCop version
0.40.0
The text was updated successfully, but these errors were encountered: