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

Fix class fields with arrays as generic type #145

Merged
merged 1 commit into from Jun 2, 2018

Conversation

Projects
None yet
2 participants
@sadikovi
Member

sadikovi commented May 30, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

This PR fixes the scope of classes with generic type being an array, e.g. Foo<int[]>. It scopes properly with the actual assignment, but variable declaration was broken (IMHO, we just forgot to add it).

Fix is simply adding missing [ and ] to the pattern. It looked like when I added a test case I was using the wrong scopes, so I changed them to actual correct ones.

Before:
before

After:
after

Alternate Designs

None were considered, due to relatively simple change.

Benefits

Fixes a bug with scoping generics with arrays.

Possible Drawbacks

None were found.

Applicable Issues

Closes #139

@sadikovi sadikovi changed the title from fix class fields with arrays as generic type to Fix class fields with arrays as generic type May 30, 2018

@sadikovi sadikovi requested a review from 50Wliu May 30, 2018

@sadikovi

This comment has been minimized.

Member

sadikovi commented May 30, 2018

@50Wliu could you have a look at this PR? Thanks!

@50Wliu

50Wliu approved these changes May 31, 2018

Does this need to be changed anywhere else (for example, lookaheads)?

@sadikovi

This comment has been minimized.

Member

sadikovi commented May 31, 2018

I also tested the fix manually on different examples of initialising variables, so far this change has been enough to provide correct scope and highlighting.

@sadikovi

This comment has been minimized.

Member

sadikovi commented Jun 1, 2018

I do not think we need to change in other places, since manual tests worked and unit tests pass. I suggest we address any other issues in follow-up PRs.

@50Wliu

This comment has been minimized.

Member

50Wliu commented Jun 1, 2018

Sounds good.

@sadikovi sadikovi merged commit f4fc17b into atom:master Jun 2, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sadikovi sadikovi deleted the sadikovi:fix-class-fields-with-array branch Jun 2, 2018

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