File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,10 @@ class SyntacticElementConstraintGenerator
629629 // /
630630 // / - From sequence to pattern, when pattern has no type information.
631631 void visitForEachPattern (Pattern *pattern, ForEachStmt *forEachStmt) {
632+ // The `where` clause should be ignored because \c visitForEachStmt
633+ // records it as a separate conjunction element to allow for a more
634+ // granular control over what contextual information is brought into
635+ // the scope during pattern + sequence and `where` clause solving.
632636 auto target = SyntacticElementTarget::forForEachStmt (
633637 forEachStmt, context.getAsDeclContext (),
634638 /* ignoreWhereClause=*/ true );
@@ -955,9 +959,9 @@ class SyntacticElementConstraintGenerator
955959
956960 // For-each pattern.
957961 //
958- // Note that we don't record a sequence or where clause here,
959- // they would be handled together with pattern because pattern can
960- // inform a type of sequence element e.g. `for i: Int8 in 0 ..< 8`
962+ // Note that we don't record a sequence here, it would be handled
963+ // together with pattern because pattern can inform a type of sequence
964+ // element e.g. `for i: Int8 in 0 ..< 8`
961965 elements.push_back (makeElement (forEachStmt->getPattern (), stmtLoc));
962966
963967 // Where clause if any.
You can’t perform that action at this time.
0 commit comments