Skip to content

Commit 16dec4c

Browse files
authored
Merge pull request #34342 from AnthonyLatsis/3-liner
AST: Add a no-type-parameters early return to findProtocolSelfReferences
2 parents be0ca0a + d8dcf8f commit 16dec4c

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
@@ -4727,6 +4727,10 @@ bool ProtocolDecl::existentialConformsToSelf() const {
47274727
static SelfReferenceInfo
47284728
findProtocolSelfReferences(const ProtocolDecl *proto, Type type,
47294729
SelfReferencePosition position) {
4730+
// If there are no type parameters, we're done.
4731+
if (!type->hasTypeParameter())
4732+
return SelfReferenceInfo();
4733+
47304734
// Tuples preserve variance.
47314735
if (auto tuple = type->getAs<TupleType>()) {
47324736
auto info = SelfReferenceInfo();

0 commit comments

Comments
 (0)