File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 24
24
#include " swift/AST/ASTPrinter.h"
25
25
#include " swift/AST/ASTVisitor.h"
26
26
#include " swift/AST/ASTWalker.h"
27
+ #include " swift/AST/ExistentialLayout.h"
27
28
#include " swift/AST/Expr.h"
28
29
#include " swift/AST/ForeignErrorConvention.h"
29
30
#include " swift/AST/GenericEnvironment.h"
@@ -442,10 +443,11 @@ void TypeChecker::checkInheritanceClause(Decl *decl,
442
443
// If this is a protocol or protocol composition type, record the
443
444
// protocols.
444
445
if (inheritedTy->isExistentialType ()) {
445
- SmallVector<ProtocolDecl *, 4 > protocols;
446
- inheritedTy->getExistentialTypeProtocols (protocols);
447
-
448
- allProtocols.insert (protocols.begin (), protocols.end ());
446
+ auto layout = inheritedTy->getExistentialLayout ();
447
+ for (auto proto : layout.getProtocols ()) {
448
+ auto *protoDecl = proto->getDecl ();
449
+ allProtocols.insert (protoDecl);
450
+ }
449
451
continue ;
450
452
}
451
453
You can’t perform that action at this time.
0 commit comments