Skip to content

[IDE] Only consider synthesized extensions when in the same module #40566

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
merged 2 commits into from
Jan 19, 2022

Conversation

bnbarham
Copy link
Contributor

Only declarations in the same module as synthesized extension's target
are placed within a synthesized extension. We should thus not add
"::SYNTHESIZED::" to the USR if the given declaration is in a different
and.

As an example, Foundation adds a method components(separatedBy:) to
String through an extension on StringProtocol. But since it is
within Foundation and not Swift it will not be in a synthesized
extension of String or StringProtocol. So it should not have
"::SYNTHESIZED::" added and should also not being in the String group.

Resolves rdar://71355632.

@bnbarham bnbarham requested review from rintaro and nkcsgexi December 15, 2021 04:58
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 31b37b983fb792e71d0611568034abc035d1b4fb

@bnbarham bnbarham force-pushed the synthesized-harmony branch from 31b37b9 to f8dc8b4 Compare December 15, 2021 07:22
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham
Copy link
Contributor Author

@nkcsgexi it'd be good to get your opinion on this one, do you know why we were grabbing the extended nominal to find the group name?

Only declarations in the same module as synthesized extension's target
are placed within a synthesized extension. We should thus not add
"::SYNTHESIZED::" to the USR if the given declaration is in a different
and.

As an example, `Foundation` adds a method `components(separatedBy:)` to
`String` through an extension on `StringProtocol`. But since it is
within `Foundation` and not `Swift` it will *not* be in a synthesized
extension of `String` or `StringProtocol`. So it should not have
"::SYNTHESIZED::" added and should also not being in the `String` group.

Resolves rdar://71355632.
@bnbarham bnbarham force-pushed the synthesized-harmony branch from f8dc8b4 to bf0bcfa Compare December 23, 2021 23:18
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bf0bcfa

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bf0bcfa

@bnbarham
Copy link
Contributor Author

@swift-ci please test Linux platform

@bnbarham
Copy link
Contributor Author

@swift-ci please test Windows platform

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

This change makes sense to me!

@bnbarham bnbarham merged commit 7337e3b into swiftlang:main Jan 19, 2022
@bnbarham bnbarham deleted the synthesized-harmony branch January 19, 2022 22:32
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.

4 participants