Skip to content

[SourceKit] Fix a crash because the API for retrieving intherited protocols of a ProtocolDecl changed #60751

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 1 commit into from
Aug 25, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 24, 2022

#60716 changed NominalTypeDecl::getAllProtocols to no longer work on ProtocolDecl. Add a new wrapper to Refactoring.cpp that dispatches to either getInheritedProtocols or getAllProtocols depending on whether the type is a protocol or not.

rdar://99096663

@ahoppen ahoppen requested review from slavapestov and rintaro August 24, 2022 19:43
@ahoppen
Copy link
Member Author

ahoppen commented Aug 24, 2022

@swift-ci Please smoke test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Makes sense. I debated allowing getAllProtocols() to return the transitive closure of getInheritedProtocols(), but wanted to add the assert there first to find the usages and see if anything they did could be expressed in a simpler way. We can refactor it later as needed though.

…tocols of a ProtocolDecl changed

swiftlang#60716 changed `NominalTypeDecl::getAllProtocols` to no longer work on `ProtocolDecl`. Add a new wrapper to Refactoring.cpp that dispatches to either `getInheritedProtocols` or `getAllProtocols` depending on whether the type is a protocol or not.

rdar://99096663
@ahoppen
Copy link
Member Author

ahoppen commented Aug 24, 2022

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 47c1fd9 into swiftlang:main Aug 25, 2022
@ahoppen ahoppen deleted the pr/rdar99096663 branch August 25, 2022 12:29
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.

3 participants