mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Fix getEffectiveOverloadType handling of mutating methods
This commit is contained in:
@@ -1833,11 +1833,15 @@ Type ConstraintSystem::getEffectiveOverloadType(ConstraintLocator *locator,
|
||||
type, var, useDC, GetClosureType{*this},
|
||||
ClosureIsolatedByPreconcurrency{*this});
|
||||
} else if (isa<AbstractFunctionDecl>(decl) || isa<EnumElementDecl>(decl)) {
|
||||
if (decl->isInstanceMember() &&
|
||||
(!overload.getBaseType() ||
|
||||
(!overload.getBaseType()->getAnyNominal() &&
|
||||
!overload.getBaseType()->is<ExistentialType>())))
|
||||
return Type();
|
||||
if (decl->isInstanceMember()) {
|
||||
auto baseTy = overload.getBaseType();
|
||||
if (!baseTy)
|
||||
return Type();
|
||||
|
||||
baseTy = baseTy->getRValueType();
|
||||
if (!baseTy->getAnyNominal() && !baseTy->is<ExistentialType>())
|
||||
return Type();
|
||||
}
|
||||
|
||||
// Cope with 'Self' returns.
|
||||
if (!decl->getDeclContext()->getSelfProtocolDecl()) {
|
||||
|
||||
Reference in New Issue
Block a user