We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a7a64a commit f1a2d75Copy full SHA for f1a2d75
lib/Sema/CSFix.cpp
@@ -2373,7 +2373,12 @@ bool AddExplicitExistentialCoercion::isRequired(
2373
if (auto *anchor = getAsExpr(locator.getAnchor())) {
2374
// If this is erasure related to `Self`, let's look through
2375
// the call, if any.
2376
- if (isa<UnresolvedDotExpr>(anchor)) {
+ if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchor)) {
2377
+ // If this is an implicit `makeIterator` call, let's skip the check.
2378
+ if (UDE->isImplicit() &&
2379
+ cs.getContextualTypePurpose(UDE->getBase()) == CTP_ForEachSequence)
2380
+ return false;
2381
+
2382
auto parentExpr = cs.getParentExpr(anchor);
2383
if (parentExpr && isa<CallExpr>(parentExpr))
2384
anchor = parentExpr;
0 commit comments