@@ -755,7 +755,7 @@ static Type applyGenericArguments(Type type, TypeResolution resolution,
755
755
// Build ParameterizedProtocolType if the protocol has a primary associated
756
756
// type and we're in a supported context (for now just generic requirements,
757
757
// inheritance clause, extension binding).
758
- if (resolution.getOptions ().isConstraintImplicitExistential ()) {
758
+ if (resolution.getOptions ().isConstraintImplicitExistential () && !ctx. LangOpts . hasFeature (Feature::ImplicitSome) ) {
759
759
diags.diagnose (loc, diag::existential_requires_any,
760
760
protoDecl->getDeclaredInterfaceType (),
761
761
protoDecl->getExistentialType (),
@@ -4686,7 +4686,7 @@ class ExistentialTypeVisitor
4686
4686
4687
4687
auto comp = T->getComponentRange ().back ();
4688
4688
if (auto *proto = dyn_cast_or_null<ProtocolDecl>(comp->getBoundDecl ())) {
4689
- if (proto->existentialRequiresAny ()) {
4689
+ if (proto->existentialRequiresAny () && !Ctx. LangOpts . hasFeature (Feature::ImplicitSome) ) {
4690
4690
Ctx.Diags .diagnose (comp->getNameLoc (),
4691
4691
diag::existential_requires_any,
4692
4692
proto->getDeclaredInterfaceType (),
@@ -4703,7 +4703,7 @@ class ExistentialTypeVisitor
4703
4703
if (type->isConstraintType ()) {
4704
4704
auto layout = type->getExistentialLayout ();
4705
4705
for (auto *protoDecl : layout.getProtocols ()) {
4706
- if (!protoDecl->existentialRequiresAny ())
4706
+ if (!protoDecl->existentialRequiresAny () || Ctx. LangOpts . hasFeature (Feature::ImplicitSome) )
4707
4707
continue ;
4708
4708
4709
4709
Ctx.Diags .diagnose (comp->getNameLoc (),
0 commit comments