@@ -33,7 +33,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
33
33
34
34
final def body : c.Tree = stats match {
35
35
case stat :: Nil => stat
36
- case _ => Block (stats : _* )
36
+ case init :+ last => Block (init, last )
37
37
}
38
38
}
39
39
@@ -94,8 +94,8 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
94
94
c.Expr [scala.util.Try [T ]](
95
95
TypeApply (Select (Ident (name.tr), newTermName(" asInstanceOf" )),
96
96
List (TypeTree (weakTypeOf[scala.util.Try [T ]]))))).tree,
97
- Block (List (tryGetTree, mkStateTree(nextState), mkResumeApply): _* )
98
- )
97
+ Block (List (tryGetTree, mkStateTree(nextState), mkResumeApply), c.literalUnit.tree )
98
+ )
99
99
100
100
Some (mkHandlerCase(state, List (ifIsFailureTree)))
101
101
}
@@ -146,7 +146,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
146
146
// 1. build changed if-else tree
147
147
// 2. insert that tree at the end of the current state
148
148
val cond = renameReset(condTree)
149
- def mkBranch (state : Int ) = Block (mkStateTree(state), mkResumeApply)
149
+ def mkBranch (state : Int ) = Block (mkStateTree(state) :: Nil , mkResumeApply)
150
150
this += If (cond, mkBranch(thenState), mkBranch(elseState))
151
151
new AsyncStateWithoutAwait (stats.toList, state)
152
152
}
@@ -177,7 +177,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
177
177
}
178
178
179
179
def resultWithLabel (startLabelState : Int ): AsyncState = {
180
- this += Block (mkStateTree(startLabelState), mkResumeApply)
180
+ this += Block (mkStateTree(startLabelState) :: Nil , mkResumeApply)
181
181
new AsyncStateWithoutAwait (stats.toList, state)
182
182
}
183
183
@@ -387,7 +387,7 @@ private[async] final case class ExprBuilder[C <: Context, FS <: FutureSystem](c:
387
387
Assign (Ident (name.state), c.literal(nextState).tree)
388
388
389
389
private def mkHandlerCase (num : Int , rhs : List [c.Tree ]): CaseDef =
390
- mkHandlerCase(num, Block (rhs : _* ))
390
+ mkHandlerCase(num, Block (rhs, c.literalUnit.tree ))
391
391
392
392
private def mkHandlerCase (num : Int , rhs : c.Tree ): CaseDef =
393
393
CaseDef (c.literal(num).tree, EmptyTree , rhs)
0 commit comments