mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add @_implementationOnly
This is an attribute that gets put on an import in library FooKit to keep it from being a requirement to import FooKit. It's not checked at all, meaning that in this form it is up to the author of FooKit to make sure nothing in its API or ABI depends on the implementation-only dependency. There's also no debugging support here (debugging FooKit /should/ import the implementation-only dependency if it's present). The goal is to get to a point where it /can/ be checked, i.e. FooKit developers are prevented from writing code that would rely on FooKit's implementation-only dependency being present when compiling clients of FooKit. But right now it's not. rdar://problem/48985979
This commit is contained in:
@@ -487,8 +487,10 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
|
||||
loadedModuleFile->getDependencies().begin(),
|
||||
loadedModuleFile->getDependencies().end(), std::back_inserter(missing),
|
||||
[&duplicates](const ModuleFile::Dependency &dependency) -> bool {
|
||||
if (dependency.isLoaded() || dependency.isHeader())
|
||||
if (dependency.isLoaded() || dependency.isHeader() ||
|
||||
dependency.isImplementationOnly()) {
|
||||
return false;
|
||||
}
|
||||
return duplicates.insert(dependency.RawPath).second;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user