Skip to content

Commit b584abe

Browse files
committed
[Sema] Enforce explicit existential 'any' behavior with feature flag
1 parent 0c36d81 commit b584abe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ ExistentialConformsToSelfRequest::evaluate(Evaluator &evaluator,
708708
bool
709709
ExistentialRequiresAnyRequest::evaluate(Evaluator &evaluator,
710710
ProtocolDecl *decl) const {
711+
auto &ctx = decl->getASTContext();
712+
if (ctx.LangOpts.hasFeature(Feature::ExistentialAny))
713+
return true;
714+
711715
// ObjC protocols do not require `any`.
712716
if (decl->isObjC())
713717
return false;

0 commit comments

Comments
 (0)