Skip to content

[5.3][SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute. #32047

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

nathawes
Copy link
Contributor

@nathawes nathawes commented May 27, 2020

Cherry-pick of #32046 for 5.3.

  • Explanation:

    ObjC decls marked with the swift_private attribute (via the NS_REFINED_FOR_SWIFT macro) are intended to be hidden from framework clients, but still exposed for use in the Swift code within the framework or its Swift overlay. We were still printing them in the generated interface of the framework though, counteracting the intention of these being hidden from clients.

  • Scope of issue: Affects interface generation only.

  • Origination: Since NS_REFINED_FOR_SWIFT was introduced (not a regression).

  • Risk: Low. The fix is simple and only impacts interface generation. The compiler and other sourcekitd requests are unaffected.

  • Testing: Added a regression test for the new behavior and all existing tests pass.

  • Reviewers: @akyrtzi on the master PR.

Resolves rdar://problem/62464954

@nathawes nathawes added the r5.3 label May 27, 2020
@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 75dd1bfdbce1fbcdf3d9c283d336d5fdbbbad79b

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 75dd1bfdbce1fbcdf3d9c283d336d5fdbbbad79b

…ft_private attribute.

This attribute is intended to mean there's a replacement declaration that
should be used instead in Swift code. We already filter out decls with this
attribute in code completion, but were still exposing them in generated
interfaces.

Resolves rdar://problem/62464954
@nathawes nathawes force-pushed the interface-gen-exposed-underscore-5.3 branch from 75dd1bf to e93c4a1 Compare May 27, 2020 22:25
@nathawes
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 75dd1bfdbce1fbcdf3d9c283d336d5fdbbbad79b

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 75dd1bfdbce1fbcdf3d9c283d336d5fdbbbad79b

@nathawes nathawes changed the title [WIP][5.3][SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute. [5.3][SourceKit][InterfaceGen] Don't print clang decls marked with the swift_private attribute. May 28, 2020
@nathawes nathawes marked this pull request as ready for review May 28, 2020 17:05
@nathawes nathawes requested a review from a team as a code owner May 28, 2020 17:05
@nathawes
Copy link
Contributor Author

@swift-ci please nominate

@tkremenek tkremenek merged commit c21b26d into swiftlang:release/5.3 May 28, 2020
@nathawes nathawes deleted the interface-gen-exposed-underscore-5.3 branch May 28, 2020 21:47
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 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.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants