Skip to content

Commit 0b4a9f5

Browse files
committed
[CSSyntacticElement] NFC: Update comments related to for-in where clause checking
1 parent 72caaa8 commit 0b4a9f5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Sema/CSSyntacticElement.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)