firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

[FR]: Switch from `@_implementationOnly` to Swift 5.9 internal package imports

Open paulb777 opened this issue 1 year ago • 1 comments

Description

Investigate switching from @_implementationOnly to Swift 5.9 internal package imports

API Proposal

No response

Firebase Product(s)

All

paulb777 avatar May 29 '24 17:05 paulb777

The AccessLevelOnImport feature being introduced in Swift 6 (SE-0409) works in Swift 5.9 by setting the following on a target in Package.swift:

swiftSettings: [
  .enableExperimentalFeature("AccessLevelOnImport")
]

However, in targets with resources, e.g., resources: [.process("Resources/PrivacyInfo.xcprivacy")], the resource_bundle_accessor.swift generated by SPM does not specify access levels resulting in errors like Ambiguous implicit access level for import of 'Foundation'; it is imported as 'public' elsewhere.

The upcoming feature InternalImportsByDefault doesn't appear to be available in Xcode 15.x but the issues above are resolved in Xcode 16. Let's hold off on using the new access-level modifiers on import declarations until Firebase moves to a minimum of Xcode 16 in the future.

andrewheard avatar Jun 14 '24 14:06 andrewheard

Mostly done and the rest is covered by #14616

paulb777 avatar Apr 15 '25 00:04 paulb777