[TypeChecker] Split for-in sequence into parsed and type-checked versions

This commit is contained in:
Pavel Yaskevich
2022-05-20 13:55:19 -07:00
parent 5f0dcb572b
commit b7860ea055
17 changed files with 64 additions and 49 deletions

View File

@@ -1011,7 +1011,7 @@ struct ForEachStmtInfo {
Type initType;
/// Implicit `$iterator = <sequence>.makeIterator()`
VarDecl *makeIteratorVar;
PatternBindingDecl *makeIteratorVar;
/// Implicit `$iterator.next()` call.
Expr *nextCall;
@@ -2434,7 +2434,7 @@ public:
case Kind::forEachStmt:
auto *stmt = forEachStmt.stmt;
SourceLoc startLoc = stmt->getForLoc();
SourceLoc endLoc = stmt->getSequence()->getEndLoc();
SourceLoc endLoc = stmt->getParsedSequence()->getEndLoc();
if (auto *whereExpr = stmt->getWhere()) {
endLoc = whereExpr->getEndLoc();