Skip to content

[5.7][CursorInfo] Report values shadowed using shorthand syntax as secondary results #58893

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

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 13, 2022

  • Explanation: When a variable is re-declared using shorthand syntax ([foo] closure capture or if let foo {), the user doesn’t perceive this as a new variable declaration. Thus, we should return the original declaration as a secondary result.
  • Scope: Cursor info of variables that are declared using the shorthand notations if let foo { or [foo]
  • Risk: Low
  • Testing: Added regression tests
  • Issue: rdar://75455650, rdar://91311033
  • Reviewer: @bnbarham on [CursorInfo] Report values shadowed using shorthand syntax as secondary results #58787

@ahoppen ahoppen requested a review from a team as a code owner May 13, 2022 14:37
@ahoppen ahoppen changed the title Pr 5.7/shorthand closure info [5.7][CursorInfo] Report values shadowed using shorthand syntax as secondary results May 13, 2022
@ahoppen ahoppen added the r5.7 label May 13, 2022
@ahoppen
Copy link
Member Author

ahoppen commented May 13, 2022

@swift-ci Please test

…ry results

When a variable is re-declared using shorthand syntax (`[foo]` closure capture or `if let foo {`), the user doesn’t perceive this as a new variable declaration. Thus, we should return the original declaration as a secondary result.

rdar://91311033
rdar://75455650
@ahoppen ahoppen force-pushed the pr-5.7/shorthand-closure-info branch from 01ad44d to 897ceec Compare May 14, 2022 06:34
@ahoppen
Copy link
Member Author

ahoppen commented May 14, 2022

@swift-ci Please test

@ahoppen ahoppen merged commit 95b1176 into swiftlang:release/5.7 May 16, 2022
@ahoppen ahoppen deleted the pr-5.7/shorthand-closure-info branch May 16, 2022 19:29
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants