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

Lint/BinaryOperatorWithIdenticalOperands error #8559

Closed
aglushkov opened this issue Aug 17, 2020 · 1 comment
Closed

Lint/BinaryOperatorWithIdenticalOperands error #8559

aglushkov opened this issue Aug 17, 2020 · 1 comment

Comments

@aglushkov
Copy link

Rubocop raises error when using redefined + method

An error occurred while Lint/BinaryOperatorWithIdenticalOperands cop was inspecting /app/uploaders/image_processors/adapters/magick/gif.rb:17:14.
undefined method `basic_literal?' for nil:NilClass
gems/rubocop-0.89.1/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb:38:in `on_send'
gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:91:in `block (2 levels) in trigger_responding_cops'
gems/rubocop-0.89.1/lib/rubocop/cop/commissioner.rb:112:in `with_cop_error_handling'

Steps to reproduce the problem

Check this code with rubocop -d --only Lint/BinaryOperatorWithIdenticalOperands

class ImageProcessors::Adapters::Magick::Gif < ImageProcessors::Adapters::Magick::Base
  private

  def call(opts)
    builder = ImageProcessing::MiniMagick
    builder = builder.coalesce
    builder = builder.dither.+ # #https://github.com/minimagick/minimagick/blob/d484786f35e91f107836d3c86aca61d50a35820b/lib/mini_magick/tool.rb#L172
    builder = crop(builder, opts)
    builder = resize(builder, opts)
    builder = builder.fuzz('5%')
    builder = builder.map.+
    builder.layers('optimize')
  end
end

RuboCop version

$ bundle exec rubocop -V
0.89.1 (using Parser 2.7.1.4, rubocop-ast 0.3.0, running on ruby 2.6.6 x86_64-linux)
@marcandre
Copy link
Contributor

Sorry for this issue. This is fixed in #8534 but not yet released.
Thanks for the bug report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants