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

barfs on def <=> #100

Closed
lloeki opened this issue Apr 26, 2013 · 1 comment
Closed

barfs on def <=> #100

lloeki opened this issue Apr 26, 2013 · 1 comment

Comments

@lloeki
Copy link
Contributor

lloeki commented Apr 26, 2013

Scanning this:

class Foo
  def <=> other
    name <=> other.name
  end
end

produces undefined method '[]' for nil:NilClass this exception:

/Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/op_method.rb:11:in `block in inspect': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block (2 levels) in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block (2 levels) in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block (2 levels) in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block (2 levels) in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block (2 levels) in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:82:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:84:in `block in each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/cop.rb:83:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cop/op_method.rb:9:in `inspect'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cli.rb:74:in `block (2 levels) in run'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cli.rb:66:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cli.rb:66:in `block in run'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cli.rb:44:in `each'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/lib/rubocop/cli.rb:44:in `run'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/bin/rubocop:13:in `block in <top (required)>'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rubocop-0.6.0/bin/rubocop:12:in `<top (required)>'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/bin/rubocop:23:in `load'
    from /Users/lloeki/.rbenv/versions/2.0.0-p0/bin/rubocop:23:in `<main>'
@lloeki
Copy link
Contributor Author

lloeki commented Apr 26, 2013

Many thanks for the really quick fixes :-)

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

No branches or pull requests

1 participant