mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Print the public keyword on imports in Swift 6 mode
If the access-level on imports proposal is accepted as written, all imports printed in swiftinterfaces will be `public`. Whether or not we require the explicit `public` keyword in Swift 6 mode, printing it will have no downside. It also goes along with the mentality that swiftinterfaces should be more explicit than implicit. rdar://115455383
This commit is contained in:
@@ -348,6 +348,10 @@ static void printImports(raw_ostream &out,
|
||||
out << "@_spi(" << spiName << ") ";
|
||||
}
|
||||
|
||||
if (M->getASTContext().LangOpts.isSwiftVersionAtLeast(6)) {
|
||||
out << "public ";
|
||||
}
|
||||
|
||||
out << "import ";
|
||||
if (Opts.AliasModuleNames &&
|
||||
AliasModuleNamesTargets.contains(importedModule->getName().str()))
|
||||
|
||||
Reference in New Issue
Block a user