@@ -2801,7 +2801,6 @@ bool TypeRepr::isProtocol(DeclContext *dc){
2801
2801
});
2802
2802
}
2803
2803
2804
-
2805
2804
static GenericParamList *
2806
2805
createExtensionGenericParams (ASTContext &ctx,
2807
2806
ExtensionDecl *ext,
@@ -2847,15 +2846,19 @@ CollectedOpaqueReprs swift::collectOpaqueReturnTypeReprs(TypeRepr *r, ASTContext
2847
2846
2848
2847
if (auto existential = dyn_cast<ExistentialTypeRepr>(repr)) {
2849
2848
return Action::SkipChildren ();
2850
- } else if (auto compositionRepr = dyn_cast<CompositionTypeRepr>(repr)) {
2851
- if (!compositionRepr ->isTypeReprAny ())
2852
- Reprs.push_back (compositionRepr );
2849
+ } else if (auto composition = dyn_cast<CompositionTypeRepr>(repr)) {
2850
+ if (!composition ->isTypeReprAny ())
2851
+ Reprs.push_back (composition );
2853
2852
return Action::SkipChildren ();
2854
2853
} else if (auto generic = dyn_cast<GenericIdentTypeRepr>(repr)) {
2855
- return Action::Continue ();
2856
- } else if (auto declRefTR = dyn_cast<DeclRefTypeRepr>(repr)) {
2857
- if (declRefTR->isProtocol (dc))
2858
- Reprs.push_back (declRefTR);
2854
+ if (generic->isProtocol (dc))
2855
+ Reprs.push_back (generic);
2856
+ if (generic->argsAreProtocols (dc))
2857
+ return Action::Continue ();
2858
+ return Action::SkipChildren ();
2859
+ } else if (auto declRef = dyn_cast<DeclRefTypeRepr>(repr)) {
2860
+ if (declRef->isProtocol (dc))
2861
+ Reprs.push_back (declRef);
2859
2862
}
2860
2863
return Action::Continue ();
2861
2864
}
0 commit comments