mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Disable availability checking when type-checking the _Concurrency interface
Swift 5.5 didn't support back deployment of concurrency features, so a Swift 5.5 compiler processing the _Concurrency .swiftinterface will produce errors for each `async` function and actor with pre-macOS 12/iOS 15 availability. Emit `-disable-availability-checking` into the generated `.swiftinterface` files to allow Swift 5.5 to continue to build them. Finishes rdar://82602353.
This commit is contained in:
@@ -370,6 +370,13 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
|
||||
interleave(RenderedArgs,
|
||||
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
|
||||
[&] { OS << " "; });
|
||||
|
||||
// Backward-compatibility hack: disable availability checking in the
|
||||
// _Concurrency module, so that older (Swift 5.5) compilers that did not
|
||||
// support back deployment of concurrency do not complain about 'async'
|
||||
// with older availability.
|
||||
if (FOpts.ModuleName == "_Concurrency")
|
||||
OS << " -disable-availability-checking";
|
||||
}
|
||||
{
|
||||
llvm::raw_string_ostream OS(Opts.IgnorableFlags);
|
||||
|
||||
Reference in New Issue
Block a user