@@ -743,7 +743,7 @@ class ForEachStmt : public LabeledStmt {
743743
744744 // Set by Sema:
745745 ProtocolConformanceRef sequenceConformance = ProtocolConformanceRef();
746- VarDecl *iteratorVar = nullptr ;
746+ PatternBindingDecl *iteratorVar = nullptr ;
747747 Expr *nextCall = nullptr ;
748748 OpaqueValueExpr *elementExpr = nullptr ;
749749 Expr *convertElementExpr = nullptr ;
@@ -759,8 +759,8 @@ class ForEachStmt : public LabeledStmt {
759759 setPattern (Pat);
760760 }
761761
762- void setIteratorVar (VarDecl *var) { iteratorVar = var; }
763- VarDecl *getIteratorVar () const { return iteratorVar; }
762+ void setIteratorVar (PatternBindingDecl *var) { iteratorVar = var; }
763+ PatternBindingDecl *getIteratorVar () const { return iteratorVar; }
764764
765765 void setNextCall (Expr *next) { nextCall = next; }
766766 Expr *getNextCall () const { return nextCall; }
@@ -802,8 +802,12 @@ class ForEachStmt : public LabeledStmt {
802802 // / by this foreach loop, as it was written in the source code and
803803 // / subsequently type-checked. To determine the semantic behavior of this
804804 // / expression to extract a range, use \c getRangeInit().
805- Expr *getSequence () const { return Sequence; }
806- void setSequence (Expr *S) { Sequence = S; }
805+ Expr *getParsedSequence () const { return Sequence; }
806+ void setParsedSequence (Expr *S) { Sequence = S; }
807+
808+ // / Type-checked version of the sequence or nullptr if this statement
809+ // / yet to be type-checked.
810+ Expr *getTypeCheckedSequence () const ;
807811
808812 // / getBody - Retrieve the body of the loop.
809813 BraceStmt *getBody () const { return Body; }
0 commit comments