Skip to content

[4.2] Discriminate local variables #16536

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

rintaro
Copy link
Member

@rintaro rintaro commented May 11, 2018

Cherry-pick of #16130 reviewed by @rjmccall

Set local discriminator for all local VarDecls (including ParamDecls). Otherwise, they cannot
be discriminated with USRs. This change is needed for rename refactoring which uses USR for discrimiating variable names.

https://bugs.swift.org/browse/SR-7205,
rdar://problem/34701880

rintaro added 5 commits May 11, 2018 15:39
Set local discriminator for all local `VarDecl`s. Otherwise, they cannot
be discriminated with USRs. This change is needed for rename refactoring which
uses USR for discrimiating variable names.

https://bugs.swift.org/browse/SR-7205,
rdar://problem/34701880
For Example `getLoc()` for `foo as Ty`(`IsPattern`) is at 'as'. We
should try to resolve this at position of 'foo'.
Local discriminators are emitted as a part of decl.
We have to discriminate between params and local variables.
@rintaro
Copy link
Member Author

rintaro commented May 11, 2018

@swift-ci Please test

@rintaro rintaro merged commit dfed20c into swiftlang:swift-4.2-branch May 12, 2018
@rintaro rintaro deleted the 4.2-parse-var-discriminator branch May 12, 2018 13:21
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

Successfully merging this pull request may close these issues.

1 participant