Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 1a3543c

Browse files
committed
Merge branch 'main' of github.com:apple/swift into tensorflow-stage
* 'main' of github.com:apple/swift: AST: Add a no-type-parameters early return to findProtocolSelfReferences
2 parents 2c3382f + 16dec4c commit 1a3543c

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
@@ -4761,6 +4761,10 @@ bool ProtocolDecl::existentialConformsToSelf() const {
47614761
static SelfReferenceInfo
47624762
findProtocolSelfReferences(const ProtocolDecl *proto, Type type,
47634763
SelfReferencePosition position) {
4764+
// If there are no type parameters, we're done.
4765+
if (!type->hasTypeParameter())
4766+
return SelfReferenceInfo();
4767+
47644768
// Tuples preserve variance.
47654769
if (auto tuple = type->getAs<TupleType>()) {
47664770
auto info = SelfReferenceInfo();

0 commit comments

Comments
 (0)