Skip to content

Commit 1439408

Browse files
authored
Merge pull request #83493 from tshortli/downgrade-new-dynamic-member-lookup-diagnostics-in-swiftinterfaces
Sema: Adjust dynamic member subscript diagnostic in swiftinterfaces
2 parents 2e99105 + 5e12e26 commit 1439408

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,8 +2158,10 @@ visitDynamicMemberLookupAttr(DynamicMemberLookupAttr *attr) {
21582158
bool shouldError = ctx.isSwiftVersionAtLeast(futureVersion);
21592159

21602160
// Diagnose as an error in resilient modules regardless of language
2161-
// version since this will break the swiftinterface.
2162-
shouldError |= decl->getModuleContext()->isResilient();
2161+
// version since this will break the swiftinterface. Don't diagnose
2162+
// cases in existing swiftinterface files, though.
2163+
shouldError |= decl->getModuleContext()->isResilient() &&
2164+
!decl->getDeclContext()->isInSwiftinterface();
21632165

21642166
auto diag = diagnose(inaccessibleCandidate->getLoc(),
21652167
diag::dynamic_member_lookup_candidate_inaccessible,

0 commit comments

Comments
 (0)