mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "Revert "Merge pull request #27057 from theblixguy/unrevert/SR-11298""
This reverts commit 7725818275.
This commit is contained in:
@@ -5628,10 +5628,16 @@ void VarDecl::emitLetToVarNoteIfSimple(DeclContext *UseDC) const {
|
||||
if (FD && !FD->isMutating() && !FD->isImplicit() && FD->isInstanceMember()&&
|
||||
!FD->getDeclContext()->getDeclaredInterfaceType()
|
||||
->hasReferenceSemantics()) {
|
||||
// Do not suggest the fix it in implicit getters
|
||||
// Do not suggest the fix-it in implicit getters
|
||||
if (auto AD = dyn_cast<AccessorDecl>(FD)) {
|
||||
if (AD->isGetter() && !AD->getAccessorKeywordLoc().isValid())
|
||||
return;
|
||||
|
||||
auto accessorDC = AD->getDeclContext();
|
||||
// Do not suggest the fix-it if `Self` is a class type.
|
||||
if (accessorDC->isTypeContext() && !accessorDC->hasValueSemantics()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto &d = getASTContext().Diags;
|
||||
|
||||
Reference in New Issue
Block a user