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
This code produces a "Useless assignment to variable - tries" error, which is not true.
def function_that_retries
tries = 1
begin
foo = bar
raise 'failure'
rescue
if foo =~ /bar/
retry if (tries += 1) <= 3
else
raise SomethingBad, 'Something is really broken.'
end
end
end
I broke it down to this minimum sample, and it seems to be that the conditional (retry if ()) doesn't count as a use of the variable.
The text was updated successfully, but these errors were encountered:
This code produces a "Useless assignment to variable - tries" error, which is not true.
I broke it down to this minimum sample, and it seems to be that the conditional (retry if ()) doesn't count as a use of the variable.
The text was updated successfully, but these errors were encountered: