Skip to content

Commit fc9f825

Browse files
committed
Sema: Replace a couple of TypeChecker::getProtocol() calls with getKnownProtocolKind() checks
1 parent d7ce517 commit fc9f825

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10686,9 +10686,8 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
1068610686
auto *sequenceProto = cast<ProtocolDecl>(
1068710687
getContextualType(baseExpr, /*forConstraint=*/false)
1068810688
->getAnyNominal());
10689-
bool isAsync = sequenceProto ==
10690-
TypeChecker::getProtocol(
10691-
ctx, SourceLoc(), KnownProtocolKind::AsyncSequence);
10689+
bool isAsync = sequenceProto->getKnownProtocolKind() ==
10690+
KnownProtocolKind::AsyncSequence;
1069210691

1069310692
auto *makeIterator = isAsync ? ctx.getAsyncSequenceMakeAsyncIterator()
1069410693
: ctx.getSequenceMakeIterator();
@@ -10704,10 +10703,8 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint(
1070410703
auto *iteratorProto = cast<ProtocolDecl>(
1070510704
getContextualType(baseExpr, /*forConstraint=*/false)
1070610705
->getAnyNominal());
10707-
bool isAsync =
10708-
iteratorProto ==
10709-
TypeChecker::getProtocol(ctx, SourceLoc(),
10710-
KnownProtocolKind::AsyncIteratorProtocol);
10706+
bool isAsync = iteratorProto->getKnownProtocolKind() ==
10707+
KnownProtocolKind::AsyncIteratorProtocol;
1071110708

1071210709
auto *next =
1071310710
isAsync ? ctx.getAsyncIteratorNext() : ctx.getIteratorNext();

0 commit comments

Comments
 (0)