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
629
629
// /
630
630
// / - From sequence to pattern, when pattern has no type information.
631
631
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.
632
636
auto target = SyntacticElementTarget::forForEachStmt (
633
637
forEachStmt, context.getAsDeclContext (),
634
638
/* ignoreWhereClause=*/ true );
@@ -955,9 +959,9 @@ class SyntacticElementConstraintGenerator
955
959
956
960
// For-each pattern.
957
961
//
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`
961
965
elements.push_back (makeElement (forEachStmt->getPattern (), stmtLoc));
962
966
963
967
// Where clause if any.
You can’t perform that action at this time.
0 commit comments