File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3079,8 +3079,11 @@ TypeRepr *ValueDecl::getOpaqueResultTypeRepr() const {
3079
3079
3080
3080
if (returnRepr && returnRepr->hasOpaque ()) {
3081
3081
return returnRepr;
3082
- } else if (returnRepr && ctx.LangOpts .hasFeature (Feature::ImplicitSome) && returnRepr->isProtocol (dc)) {
3083
- return returnRepr;
3082
+ } else if (returnRepr && ctx.LangOpts .hasFeature (Feature::ImplicitSome)) {
3083
+ auto opaqueReprs = collectOpaqueReturnTypeReprs (returnRepr,
3084
+ getASTContext (),
3085
+ getDeclContext ());
3086
+ return opaqueReprs.empty () ? nullptr : returnRepr;
3084
3087
} else {
3085
3088
return nullptr ;
3086
3089
}
Original file line number Diff line number Diff line change @@ -112,4 +112,6 @@ protocol P {
112
112
113
113
struct S : P {
114
114
var value : P { self }
115
+
116
+ var asExistential : any P { self }
115
117
}
You can’t perform that action at this time.
0 commit comments