@@ -33,7 +33,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
3333
3434 final def body : c.Tree = stats match {
3535 case stat :: Nil => stat
36- case _ => Block (stats : _* )
36+ case init :+ last => Block (init, last )
3737 }
3838 }
3939
@@ -94,8 +94,8 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
9494 c.Expr [scala.util.Try [T ]](
9595 TypeApply (Select (Ident (name.tr), newTermName(" asInstanceOf" )),
9696 List (TypeTree (weakTypeOf[scala.util.Try [T ]]))))).tree,
97- Block (List (tryGetTree, mkStateTree(nextState), mkResumeApply) : _* )
98- )
97+ Block (List (tryGetTree, mkStateTree(nextState)) , mkResumeApply)
98+ )
9999
100100 Some (mkHandlerCase(state, List (ifIsFailureTree)))
101101 }
@@ -146,7 +146,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
146146 // 1. build changed if-else tree
147147 // 2. insert that tree at the end of the current state
148148 val cond = renameReset(condTree)
149- def mkBranch (state : Int ) = Block (mkStateTree(state), mkResumeApply)
149+ def mkBranch (state : Int ) = Block (mkStateTree(state) :: Nil , mkResumeApply)
150150 this += If (cond, mkBranch(thenState), mkBranch(elseState))
151151 new AsyncStateWithoutAwait (stats.toList, state)
152152 }
@@ -177,7 +177,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
177177 }
178178
179179 def resultWithLabel (startLabelState : Int ): AsyncState = {
180- this += Block (mkStateTree(startLabelState), mkResumeApply)
180+ this += Block (mkStateTree(startLabelState) :: Nil , mkResumeApply)
181181 new AsyncStateWithoutAwait (stats.toList, state)
182182 }
183183
@@ -387,7 +387,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
387387 Assign (Ident (name.state), c.literal(nextState).tree)
388388
389389 private def mkHandlerCase (num : Int , rhs : List [c.Tree ]): CaseDef =
390- mkHandlerCase(num, Block (rhs : _* ))
390+ mkHandlerCase(num, Block (rhs, c.literalUnit.tree ))
391391
392392 private def mkHandlerCase (num : Int , rhs : c.Tree ): CaseDef =
393393 CaseDef (c.literal(num).tree, EmptyTree , rhs)
0 commit comments