Skip to content

Commit a6c88ee

Browse files
committed
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.
1 parent 95d84d6 commit a6c88ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ static void SaveModuleInterfaceArgs(ModuleInterfaceOptions &Opts,
370370
interleave(RenderedArgs,
371371
[&](const char *Argument) { PrintArg(OS, Argument, StringRef()); },
372372
[&] { OS << " "; });
373+
374+
// Backward-compatibility hack: disable availability checking in the
375+
// _Concurrency module, so that older (Swift 5.5) compilers that did not
376+
// support back deployment of concurrency do not complain about 'async'
377+
// with older availability.
378+
if (FOpts.ModuleName == "_Concurrency")
379+
OS << " -disable-availability-checking";
373380
}
374381
{
375382
llvm::raw_string_ostream OS(Opts.IgnorableFlags);

0 commit comments

Comments
 (0)