aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/internal/AsyncTransform.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-01-28 08:22:26 +0100
committerJason Zaugg <jzaugg@gmail.com>2014-01-28 08:22:26 +0100
commit72112ced2deed859ff9dfa1a1c010217bb98114f (patch)
tree8df011593dfd58e22342727fcc0a10f35e451691 /src/main/scala/scala/async/internal/AsyncTransform.scala
parentdb4ceca523a7e07bdbed8678fe962d273118ebc3 (diff)
downloadscala-async-72112ced2deed859ff9dfa1a1c010217bb98114f.tar.gz
scala-async-72112ced2deed859ff9dfa1a1c010217bb98114f.tar.bz2
scala-async-72112ced2deed859ff9dfa1a1c010217bb98114f.zip
Unhardcode use of scala.util.Try
In favour of the type defined by the active FutureSystem.
Diffstat (limited to 'src/main/scala/scala/async/internal/AsyncTransform.scala')
-rw-r--r--src/main/scala/scala/async/internal/AsyncTransform.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/scala/scala/async/internal/AsyncTransform.scala b/src/main/scala/scala/async/internal/AsyncTransform.scala
index 352ef71..ca53ff1 100644
--- a/src/main/scala/scala/async/internal/AsyncTransform.scala
+++ b/src/main/scala/scala/async/internal/AsyncTransform.scala
@@ -51,7 +51,8 @@ trait AsyncTransform {
List(emptyConstructor, stateVar, result, execContextValDef) ++ List(resumeFunTreeDummyBody, applyDefDefDummyBody, apply0DefDef, extraValDef)
}
- val template = Template(List(typeOf[(scala.util.Try[Any] => Unit)], typeOf[() => Unit]).map(TypeTree(_)), emptyValDef, body)
+ val tryToUnit = appliedType(definitions.FunctionClass(1), futureSystemOps.tryType[Any], typeOf[Unit])
+ val template = Template(List(tryToUnit, typeOf[() => Unit]).map(TypeTree(_)), emptyValDef, body)
val t = ClassDef(NoMods, name.stateMachineT, Nil, template)
callSiteTyper.typedPos(macroPos)(Block(t :: Nil, Literal(Constant(()))))