File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -1471,19 +1471,13 @@ Type ConstraintSystem::getMemberReferenceTypeFromOpenedType(
14711471 getDynamicSelfReplacementType (baseObjTy, value, locator);
14721472
14731473 if (auto func = dyn_cast<AbstractFunctionDecl>(value)) {
1474- if (func-> hasDynamicSelfResult ( ) &&
1474+ if (isa<ConstructorDecl>(func ) &&
14751475 !baseObjTy->getOptionalObjectType ()) {
14761476 type = type->replaceCovariantResultType (replacementTy, 2 );
14771477 }
1478- } else if (auto *decl = dyn_cast<SubscriptDecl>(value)) {
1479- if (decl->getElementInterfaceType ()->hasDynamicSelfType ()) {
1480- type = type->replaceCovariantResultType (replacementTy, 2 );
1481- }
1482- } else if (auto *decl = dyn_cast<VarDecl>(value)) {
1483- if (decl->getValueInterfaceType ()->hasDynamicSelfType ()) {
1484- type = type->replaceCovariantResultType (replacementTy, 1 );
1485- }
14861478 }
1479+
1480+ type = type->replaceDynamicSelfType (replacementTy);
14871481 }
14881482
14891483 // Check if we need to apply a layer of optionality to the uncurried type.
You can’t perform that action at this time.
0 commit comments