File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -2083,18 +2083,17 @@ bool AllowTypeOrInstanceMemberFailure::diagnoseAsError() {
2083
2083
2084
2084
auto *initCall = cs.getParentExpr (cs.getParentExpr (ctorRef));
2085
2085
2086
- auto isImmutable = [&DC](ValueDecl *decl) {
2086
+ auto isMutable = [&DC](ValueDecl *decl) {
2087
2087
if (auto *storage = dyn_cast<AbstractStorageDecl>(decl))
2088
- return !storage->isSettable (DC) ||
2089
- !storage->isSetterAccessibleFrom (DC);
2088
+ return storage->isSettable (DC) && storage->isSetterAccessibleFrom (DC);
2090
2089
2091
- return false ;
2090
+ return true ;
2092
2091
};
2093
2092
2094
2093
auto selection = getChoiceFor (ctorRef->getBase ());
2095
2094
if (selection) {
2096
2095
OverloadChoice choice = selection.getValue ().choice ;
2097
- if (choice.isDecl () && ! isImmutable (choice.getDecl ()) &&
2096
+ if (choice.isDecl () && isMutable (choice.getDecl ()) &&
2098
2097
!isCallArgument (initCall) &&
2099
2098
cs.getContextualTypePurpose () == CTP_Unused) {
2100
2099
auto fixItLoc = ctorRef->getBase ()->getSourceRange ().End ;
You can’t perform that action at this time.
0 commit comments