Skip to content

Commit fd62b9c

Browse files
authored
Merge pull request #38087 from DougGregor/conditional-concurrency-standard-substitutions-5.5
Disable standard substitutions when building with "older" _Concurrency module
2 parents 25a545c + 9c9fef1 commit fd62b9c

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
@@ -1427,9 +1427,19 @@ bool ModuleDecl::isStdlibModule() const {
14271427
}
14281428

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

14351445
bool ModuleDecl::isSwiftShimsModule() const {

0 commit comments

Comments
 (0)