Skip to content

Commit 90f13e7

Browse files
committed
Address deprecation warnings in Scala 2.10.1
1 parent b87b924 commit 90f13e7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
scalaVersion := "2.10.0"
1+
scalaVersion := "2.10.1"
22

3-
organization := "org.typesafe.async"
3+
organization := "org.typesafe.async" // TODO new org name under scala-lang.
44

55
name := "scala-async"
66

src/main/scala/scala/async/Async.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ abstract class AsyncBase {
152152
else {
153153
Block(List[Tree](
154154
stateMachine,
155-
ValDef(NoMods, name.stateMachine, stateMachineType, New(Ident(name.stateMachineT), Nil)),
155+
ValDef(NoMods, name.stateMachine, stateMachineType, Apply(Select(New(Ident(name.stateMachineT)), nme.CONSTRUCTOR), Nil)),
156156
futureSystemOps.spawn(Apply(selectStateMachine(name.apply), Nil))
157157
),
158158
futureSystemOps.promiseToFuture(c.Expr[futureSystem.Prom[T]](selectStateMachine(name.result))).tree)

src/main/scala/scala/async/AsyncAnalysis.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private[async] final case class AsyncAnalysis[C <: Context](c: C, asyncBase: Asy
159159
nextChunk()
160160
case vd: ValDef =>
161161
super.traverse(tree)
162-
valDefChunkId += (vd.symbol ->(vd, chunkId))
162+
valDefChunkId += (vd.symbol -> (vd -> chunkId))
163163
val isPatternBinder = vd.name.toString.contains(name.bindSuffix)
164164
if (isAwait(vd.rhs) || isPatternBinder) valDefsToLift += vd
165165
case as: Assign =>

src/main/scala/scala/async/ExprBuilder.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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), c.literalUnit.tree)
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

Comments
 (0)