mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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},
|
type, var, useDC, GetClosureType{*this},
|
||||||
ClosureIsolatedByPreconcurrency{*this});
|
ClosureIsolatedByPreconcurrency{*this});
|
||||||
} else if (isa<AbstractFunctionDecl>(decl) || isa<EnumElementDecl>(decl)) {
|
} else if (isa<AbstractFunctionDecl>(decl) || isa<EnumElementDecl>(decl)) {
|
||||||
if (decl->isInstanceMember() &&
|
if (decl->isInstanceMember()) {
|
||||||
(!overload.getBaseType() ||
|
auto baseTy = overload.getBaseType();
|
||||||
(!overload.getBaseType()->getAnyNominal() &&
|
if (!baseTy)
|
||||||
!overload.getBaseType()->is<ExistentialType>())))
|
return Type();
|
||||||
return Type();
|
|
||||||
|
baseTy = baseTy->getRValueType();
|
||||||
|
if (!baseTy->getAnyNominal() && !baseTy->is<ExistentialType>())
|
||||||
|
return Type();
|
||||||
|
}
|
||||||
|
|
||||||
// Cope with 'Self' returns.
|
// Cope with 'Self' returns.
|
||||||
if (!decl->getDeclContext()->getSelfProtocolDecl()) {
|
if (!decl->getDeclContext()->getSelfProtocolDecl()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user