Skip to content

Commit 72cc0fe

Browse files
committed
AST: Don't look at stored properties of resilient structs in getConcurrencyDiagnosticBehaviorLimitRec()
1 parent ccea096 commit 72cc0fe

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

lib/AST/Type.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5238,17 +5238,21 @@ getConcurrencyDiagnosticBehaviorLimitRec(
52385238
// merging our fields if we have a struct.
52395239
if (auto *structDecl = dyn_cast<StructDecl>(nomDecl)) {
52405240
std::optional<DiagnosticBehavior> diagnosticBehavior;
5241-
auto substMap = type->getContextSubstitutionMap();
5242-
for (auto storedProperty : structDecl->getStoredProperties()) {
5243-
auto lhs = diagnosticBehavior.value_or(DiagnosticBehavior::Unspecified);
5244-
auto astType = storedProperty->getInterfaceType().subst(substMap);
5245-
auto rhs = getConcurrencyDiagnosticBehaviorLimitRec(astType, declCtx,
5246-
visited);
5247-
auto result = lhs.merge(rhs.value_or(DiagnosticBehavior::Unspecified));
5248-
if (result != DiagnosticBehavior::Unspecified)
5249-
diagnosticBehavior = result;
5241+
5242+
if (!nomDecl->isResilient(declCtx->getParentModule(),
5243+
ResilienceExpansion::Maximal)) {
5244+
auto substMap = type->getContextSubstitutionMap();
5245+
for (auto storedProperty : structDecl->getStoredProperties()) {
5246+
auto lhs = diagnosticBehavior.value_or(DiagnosticBehavior::Unspecified);
5247+
auto astType = storedProperty->getInterfaceType().subst(substMap);
5248+
auto rhs = getConcurrencyDiagnosticBehaviorLimitRec(astType, declCtx,
5249+
visited);
5250+
auto result = lhs.merge(rhs.value_or(DiagnosticBehavior::Unspecified));
5251+
if (result != DiagnosticBehavior::Unspecified)
5252+
diagnosticBehavior = result;
5253+
}
5254+
return diagnosticBehavior;
52505255
}
5251-
return diagnosticBehavior;
52525256
}
52535257
}
52545258

0 commit comments

Comments
 (0)