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

#{nil} incorrectly changed by nil in a string #10944

Closed
jchatel opened this issue Aug 21, 2022 · 0 comments · Fixed by #10945
Closed

#{nil} incorrectly changed by nil in a string #10944

jchatel opened this issue Aug 21, 2022 · 0 comments · Fixed by #10945
Labels

Comments

@jchatel
Copy link

jchatel commented Aug 21, 2022

puts "#{nil}" is converted to puts('nil')

puts "#{nil}" outputs empty string
puts('nil') outputs nil


Expected behavior

not changing #{nil} to nil

Actual behavior

it changed the output of the function and out test failed, we have #{nil} in a long string with many other elements to compare

RuboCop version

1.35.0

@koic koic added the bug label Aug 21, 2022
koic added a commit to koic/rubocop that referenced this issue Aug 21, 2022
…nterpolation`

Fixes rubocop#10944.

This PR fixes an incorrect autocorrect for `Lint/LiteralInInterpolation`
when using `"#{nil}"`.
koic added a commit that referenced this issue Aug 22, 2022
…lint_literal_in_interpolation

[Fix #10944] Fix an incorrect autocorrect for `Lint/LiteralInInterpolation`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants