Skip to content

Commit 92beb71

Browse files
authored
Merge pull request #37923 from DougGregor/conditional-concurrency-standard-substitutions
Disable standard substitutions when building with "older" _Concurrency module
2 parents 6c2c03d + de8c8f5 commit 92beb71

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/AST/Module.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,9 +1428,19 @@ bool ModuleDecl::isStdlibModule() const {
14281428
}
14291429

14301430
bool ModuleDecl::hasStandardSubstitutions() const {
1431-
return !getParent() &&
1432-
(getName() == getASTContext().StdlibModuleName ||
1433-
getName() == getASTContext().Id_Concurrency);
1431+
if (getParent())
1432+
return false;
1433+
1434+
if (getName() == getASTContext().StdlibModuleName)
1435+
return true;
1436+
1437+
// The _Concurrency module gets standard substitutions with "new enough"
1438+
// versions of the module.
1439+
if (getName() == getASTContext().Id_Concurrency &&
1440+
getASTContext().getProtocol(KnownProtocolKind::SerialExecutor))
1441+
return true;
1442+
1443+
return false;
14341444
}
14351445

14361446
bool ModuleDecl::isSwiftShimsModule() const {

0 commit comments

Comments
 (0)