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

Layout/MultilineMethodCallIndentation error when parsing Dry::Monads::Try expression #7825

Closed
nicholashibberd opened this issue Mar 27, 2020 · 0 comments · Fixed by #7828
Closed
Labels

Comments

@nicholashibberd
Copy link

Rubocop crashes when valid syntax according to https://dry-rb.org/gems/dry-monads/1.0/try/ is spread over two lines


Expected behavior

To generate a rubocop offence

Actual behavior

An error occurred while Layout/MultilineMethodCallIndentation cop was inspecting ...
undefined method `dot' for #<Parser::Source::Map::Collection:0x00007fcdc8232448>

Steps to reproduce the problem

AllCops:
  TargetRubyVersion: 2.6.2
# frozen_string_literal: true

require 'dry/monads'

class ExceptionalLand
  include Dry::Monads[:try]

  def call
    Try[ZeroDivisionError] { 10 / 0 }
      .fmap { |x| x * 3 }
  end
end

RuboCop version

$ [bundle exec] rubocop -V
0.80.1 (using Parser 2.7.0.5, running on ruby 2.6.2 x86_64-darwin18)
@koic koic added the bug label Mar 27, 2020
tejasbubane added a commit to tejasbubane/rubocop that referenced this issue Mar 29, 2020
koic added a commit that referenced this issue Mar 29, 2020
[Fix #7825] Fix crash for `Layout/MultilineMethodCallIndentation`
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