Skip to content

Remove @_implementationOnly annotations #225

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
Mar 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/Algorithms/RandomSample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
//===----------------------------------------------------------------------===//

// For log(_:) and root(_:_:)
#if swift(>=5.11)
internal import RealModule
#elseif swift(>=5.10)
import RealModule

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.

#else
@_implementationOnly
import RealModule
#endif

//===----------------------------------------------------------------------===//
// randomStableSample(count:)
Expand Down