Skip to content

Commit d8dcf8f

Browse files
committed
AST: Add a no-type-parameters early return to findProtocolSelfReferences
1 parent ec10c5d commit d8dcf8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/Decl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4704,6 +4704,10 @@ bool ProtocolDecl::existentialConformsToSelf() const {
47044704
static SelfReferenceInfo
47054705
findProtocolSelfReferences(const ProtocolDecl *proto, Type type,
47064706
SelfReferencePosition position) {
4707+
// If there are no type parameters, we're done.
4708+
if (!type->hasTypeParameter())
4709+
return SelfReferenceInfo();
4710+
47074711
// Tuples preserve variance.
47084712
if (auto tuple = type->getAs<TupleType>()) {
47094713
auto info = SelfReferenceInfo();

0 commit comments

Comments
 (0)