@@ -1496,24 +1496,26 @@ bool ConstraintSystem::generateConstraints(SingleValueStmtExpr *E) {
14961496 setType (E, resultType);
14971497
14981498 if (E->getStmtKind () == SingleValueStmtExpr::Kind::For) {
1499- auto *rrcProtocol = ctx.getProtocol (KnownProtocolKind::RangeReplaceableCollection);
1499+ auto *rrcProtocol =
1500+ ctx.getProtocol (KnownProtocolKind::RangeReplaceableCollection);
15001501 auto *sequenceProtocol = ctx.getProtocol (KnownProtocolKind::Sequence);
15011502
1502- addConstraint (ConstraintKind::ConformsTo,
1503- resultType,
1504- rrcProtocol->getDeclaredInterfaceType (),
1505- loc);
1503+ addConstraint (ConstraintKind::ConformsTo, resultType,
1504+ rrcProtocol->getDeclaredInterfaceType (), loc);
15061505 Type elementTypeVar = createTypeVariable (loc, /* options*/ 0 );
1507- Type elementType = DependentMemberType::get (resultType, sequenceProtocol->getAssociatedType (ctx.Id_Element ));
1506+ Type elementType = DependentMemberType::get (
1507+ resultType, sequenceProtocol->getAssociatedType (ctx.Id_Element ));
15081508
15091509 addConstraint (ConstraintKind::Bind, elementTypeVar, elementType, loc);
1510- addConstraint (ConstraintKind::Defaultable, resultType, ArraySliceType::get (elementTypeVar), loc);
1510+ addConstraint (ConstraintKind::Defaultable, resultType,
1511+ ArraySliceType::get (elementTypeVar), loc);
15111512
15121513 auto *binding = E->getForExpressionPreamble ()->ForAccumulatorBinding ;
15131514
15141515 auto *initializer = binding->getInit (0 );
1515- auto target = SyntacticElementTarget::forInitialization (initializer, Type (), binding, 0 , false );
1516- setTargetFor ({ binding, 0 }, target);
1516+ auto target = SyntacticElementTarget::forInitialization (initializer, Type (),
1517+ binding, 0 , false );
1518+ setTargetFor ({binding, 0 }, target);
15171519
15181520 if (generateConstraints (target)) {
15191521 return true ;
@@ -1552,15 +1554,15 @@ bool ConstraintSystem::generateConstraints(SingleValueStmtExpr *E) {
15521554
15531555 if (E->getStmtKind () != SingleValueStmtExpr::Kind::For) {
15541556 if (branches.empty ()) {
1555- // If we only have statement branches, the expression is typed as Void. This
1556- // should only be the case for 'if' and 'switch' statements that must be
1557- // expressions that have branches that all end in a throw, and we'll warn
1558- // that we've inferred Void.
1557+ // If we only have statement branches, the expression is typed as Void.
1558+ // This should only be the case for 'if' and 'switch' statements that must
1559+ // be expressions that have branches that all end in a throw, and we'll
1560+ // warn that we've inferred Void.
15591561 addConstraint (ConstraintKind::Bind, resultType, ctx.getVoidType (), loc);
15601562 } else {
15611563 // Otherwise, we join the result types for each of the branches.
15621564 join = TypeJoinExpr::forBranchesOfSingleValueStmtExpr (
1563- ctx, resultType, E, AllocationArena::ConstraintSolver);
1565+ ctx, resultType, E, AllocationArena::ConstraintSolver);
15641566 }
15651567 }
15661568
@@ -1605,8 +1607,8 @@ bool ConstraintSystem::generateConstraints(SingleValueStmtExpr *E) {
16051607 *this , ConstraintKind::Bind, resultType, closureResultTy, loc);
16061608 bindToClosure->setFavored ();
16071609
1608- auto *bindToVoid = Constraint::create (* this , ConstraintKind::Bind,
1609- resultType, ctx.getVoidType (), loc);
1610+ auto *bindToVoid = Constraint::create (
1611+ * this , ConstraintKind::Bind, resultType, ctx.getVoidType (), loc);
16101612
16111613 addDisjunctionConstraint ({bindToClosure, bindToVoid}, loc);
16121614 }
@@ -2701,7 +2703,7 @@ bool ConstraintSystem::applySolutionToSingleValueStmt(
27012703
27022704 if (SVE->getStmtKind () == SingleValueStmtExpr::Kind::For) {
27032705 auto *binding = SVE->getForExpressionPreamble ()->ForAccumulatorBinding ;
2704- auto target = getTargetFor ({ binding, 0 }).value ();
2706+ auto target = getTargetFor ({binding, 0 }).value ();
27052707
27062708 auto newTarget = rewriter.rewriteTarget (target);
27072709 if (!newTarget) {
0 commit comments