Skip to content

Remove @_implementationOnly annotations#225

Merged
natecook1000 merged 1 commit into
apple:mainfrom
marcosgriselli:main
Mar 9, 2024
Merged

Remove @_implementationOnly annotations#225
natecook1000 merged 1 commit into
apple:mainfrom
marcosgriselli:main

Conversation

@marcosgriselli
Copy link
Copy Markdown
Contributor

These annotations produce warnings when compiling without library evolution using Swift ≥5.10.

Replace them by private import when compiling using Swift ≥5.11.

Mirrors swiftlang/swift-syntax#2429

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Signed-off-by: Marcos Griselli <marcosg@lyft.com>
@marcosgriselli marcosgriselli changed the title Remove @_implementationOnly annotations Remove @_implementationOnly annotations Feb 29, 2024
@marcosgriselli
Copy link
Copy Markdown
Contributor Author

@natecook1000 sorry for the ping, can we add a reviewer for this?

@LucianoPAlmeida
Copy link
Copy Markdown
Contributor

@swift-ci Please test

@natecook1000
Copy link
Copy Markdown
Member

Looks great, thanks @marcosgriselli!

@natecook1000 natecook1000 merged commit 33abb69 into apple:main Mar 9, 2024
#if swift(>=5.11)
internal import RealModule
#elseif swift(>=5.10)
import RealModule
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Importing RealModule without @_implementationOnly in Swift 5.10, but with @_implementationOnly in Swift 5.9 doesn't make sense to me. With @_implementationOnly the dependency is hidden from dependents entirely. Without it, the dependency is exposed to dependents. If in practice it is ok to expose the RealModule dependency to dependents (as it seems it must be) then it would be more consistent to simply remove @_implementationOnly for <= 5.10, rather than having different semantics for 5.10 and <= 5.9.

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