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

ConstantName Cop error #235

Closed
lawliet89 opened this issue Jun 5, 2013 · 3 comments
Closed

ConstantName Cop error #235

lawliet89 opened this issue Jun 5, 2013 · 3 comments
Labels

Comments

@lawliet89
Copy link

While running rubocop, I got the following error:

An error occurred while ConstantName cop was inspecting '.../'
undefined method `type' for nil:NilClass

This could probably be because I have some assignments of nil to a variable.

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 5, 2013

Could you paste here the snippet of code that was under inspection when the error occurred?

@lawliet89
Copy link
Author

Seems to be caused by these few lines:

class Foo:
  DATA_ERROR_MASK = 2**7
  META_ERROR_MASK, BODY_ERROR_MASK, MISSING_INCLUDES_MASK =
      (1..3).map { |i| 2**i }

  OK_STATUS = 0
  INTERNAL_ERROR_STATUS, USAGE_ERROR_STATUS = [1, 2]

  CONVERT_COMMAND = 'test'

  # ...

end

@jonas054
Copy link
Collaborator

jonas054 commented Jun 7, 2013

The colon after the class name is just a typo, right? I sense an influence from python. But that's OK. 😄
I'll try to solve the problem.

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

No branches or pull requests

3 participants