We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09067cf commit 77e1626Copy full SHA for 77e1626
lib/Sema/TypeCheckDecl.cpp
@@ -2091,6 +2091,9 @@ llvm::Expected<SelfAccessKind>
2091
SelfAccessKindRequest::evaluate(Evaluator &evaluator, FuncDecl *FD) const {
2092
if (FD->getAttrs().getAttribute<MutatingAttr>(true)) {
2093
if (!FD->isInstanceMember() || !FD->getDeclContext()->hasValueSemantics()) {
2094
+ // If this decl is on a class-constrained protocol extension, then
2095
+ // the respect the explicit mutatingness. Otherwise, we would throw an
2096
+ // error and break source compatibility.
2097
if (FD->getDeclContext()->isClassConstrainedProtocolExtension())
2098
return SelfAccessKind::Mutating;
2099
return SelfAccessKind::NonMutating;
0 commit comments