[Serialization] Load non-public dependencies of modules when testing is enabled #64522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Non-public dependencies may be referenced from internal decls in a module with testing enabled. If that module is imported as testable by a client, the client can access those internal decls and references for which it needs to load the dependencies.
Ensure that we load transitive non-public dependencies from modules that enabled testing. To do so, we differentiate
internal
andfileprivate
imports from implementation-only imports at the module-wide level to offer a different module loading strategy.rdar://106514965
I'm suggesting something similar for implementation-only imports in #64509, where the dependency can only be optional as adding them as required could break projects.