File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -7972,12 +7972,8 @@ static Optional<SolutionApplicationTarget> applySolutionToForEachStmt(
7972
7972
auto stmt = forEachStmtInfo.stmt ;
7973
7973
auto sequenceProto = TypeChecker::getProtocol (
7974
7974
cs.getASTContext (), stmt->getForLoc (), KnownProtocolKind::Sequence);
7975
- auto contextualLocator = solution.getConstraintLocator (
7976
- target.getAsExpr (),
7977
- {LocatorPathElt::ContextualType (),
7978
- LocatorPathElt::ConformanceRequirement (sequenceProto)});
7979
- auto sequenceConformance =
7980
- solution.resolveConformance (contextualLocator, sequenceProto);
7975
+ auto sequenceConformance = TypeChecker::conformsToProtocol (
7976
+ forEachStmtInfo.sequenceType , sequenceProto, cs.DC );
7981
7977
assert (!sequenceConformance.isInvalid () &&
7982
7978
" Couldn't find sequence conformance" );
7983
7979
Original file line number Diff line number Diff line change @@ -5721,18 +5721,17 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
5721
5721
// / Record the given conformance as the result, adding any conditional
5722
5722
// / requirements if necessary.
5723
5723
auto recordConformance = [&](ProtocolConformanceRef conformance) {
5724
- auto *conformanceLoc = getConstraintLocator (
5725
- loc, LocatorPathElt::ConformanceRequirement (protocol));
5726
- // Record the conformance.
5727
- CheckedConformances.push_back ({conformanceLoc, conformance});
5728
-
5729
- if (isConformanceUnavailable (conformance, conformanceLoc))
5724
+ if (isConformanceUnavailable (conformance, loc))
5730
5725
increaseScore (SK_Unavailable);
5731
5726
5732
5727
// This conformance may be conditional, in which case we need to consider
5733
5728
// those requirements as constraints too.
5734
5729
if (conformance.isConcrete ()) {
5735
5730
unsigned index = 0 ;
5731
+ auto *conformanceLoc = getConstraintLocator (
5732
+ loc,
5733
+ LocatorPathElt::ConformanceRequirement (conformance.getConcrete ()));
5734
+
5736
5735
for (const auto &req : conformance.getConditionalRequirements ()) {
5737
5736
addConstraint (
5738
5737
req, getConstraintLocator (conformanceLoc,
You can’t perform that action at this time.
0 commit comments