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 initial(thing.var), where var is a list #307

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

spookydonut
Copy link
Collaborator

Closes #284

Copy link
Owner

@SpaceManiac SpaceManiac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Error message should be more descriptive about what the issue is. Along the lines of:
    initial() called on var/list/{}, but it always returns null for lists
  2. The for loop here will give redundant errors if you write initial(a.b.c.d). Should probably just pull .last().
  3. It might make sense to apply this to anything that isn't a primitve, rather than lists, because new /obj likewise returns null from initial().
  4. Could go either way on this but it might make sense to analyze the actual initial values of that variable for subtypes to see if they are non-primitives, rather than just the static types.

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

Successfully merging this pull request may close these issues.

[Feature Request] Lint again initial(thing.var), where var is a list
2 participants