mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Load non-public transitive dependencies on @testable imports
A @testable import allows a client to call internal decls which may refer to non-public dependencies. To support such a use case, load non-public transitive dependencies of a module when it's imported @testable from the main module. This replaces the previous behavior where we loaded those dependencies for any modules built for testing. This was risky as we would load more module for any debug build, opening the door to a different behavior between debug and release builds. In contrast, applying this logic to @testable clients will only change the behavior of test targets. rdar://107329303
This commit is contained in:
@@ -614,11 +614,17 @@ public:
|
||||
///
|
||||
/// If \p packageName is set, transitive package dependencies are loaded if
|
||||
/// loaded from the same package.
|
||||
///
|
||||
/// If \p forTestable, get the desired loading behavior for a @testable
|
||||
/// import. Reports non-public dependencies as required for a testable
|
||||
/// client so it can access internal details, which in turn can reference
|
||||
/// those non-public dependencies.
|
||||
ModuleLoadingBehavior
|
||||
getTransitiveLoadingBehavior(const Dependency &dependency,
|
||||
bool debuggerMode,
|
||||
bool isPartialModule,
|
||||
StringRef packageName) const;
|
||||
StringRef packageName,
|
||||
bool forTestable) const;
|
||||
};
|
||||
|
||||
template <typename T, typename RawData>
|
||||
|
||||
Reference in New Issue
Block a user