mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Typechecker] Do not incorrectly mark explicitly mutating methods as non-mutatingif we're in a class-constrained protocol extension
This commit is contained in:
@@ -1043,6 +1043,17 @@ bool DeclContext::hasValueSemantics() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DeclContext::isClassConstrainedProtocolExtension() const {
|
||||
if (auto ED = dyn_cast<ExtensionDecl>(this)) {
|
||||
if (ED->getExtendedType()->isExistentialType()) {
|
||||
return ED->getGenericSignature()->requiresClass(
|
||||
ED->getSelfInterfaceType());
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
SourceLoc swift::extractNearestSourceLoc(const DeclContext *dc) {
|
||||
switch (dc->getContextKind()) {
|
||||
case DeclContextKind::AbstractFunctionDecl:
|
||||
|
||||
Reference in New Issue
Block a user