diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-28 08:22:26 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-28 08:22:26 +0100 |
commit | 72112ced2deed859ff9dfa1a1c010217bb98114f (patch) | |
tree | 8df011593dfd58e22342727fcc0a10f35e451691 /src/main/scala | |
parent | db4ceca523a7e07bdbed8678fe962d273118ebc3 (diff) | |
download | scala-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')
-rw-r--r-- | src/main/scala/scala/async/internal/AsyncTransform.scala | 3 | ||||
-rw-r--r-- | src/main/scala/scala/async/internal/TransformUtils.scala | 4 |
2 files changed, 2 insertions, 5 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(())))) diff --git a/src/main/scala/scala/async/internal/TransformUtils.scala b/src/main/scala/scala/async/internal/TransformUtils.scala index 45baa48..f228e1d 100644 --- a/src/main/scala/scala/async/internal/TransformUtils.scala +++ b/src/main/scala/scala/async/internal/TransformUtils.scala @@ -84,10 +84,6 @@ private[async] trait TransformUtils { self.splice.get } - val TryClass = rootMirror.staticClass("scala.util.Try") - val Try_get = TryClass.typeSignature.member(newTermName("get")).ensuring(_ != NoSymbol) - val Try_isFailure = TryClass.typeSignature.member(newTermName("isFailure")).ensuring(_ != NoSymbol) - val TryAnyType = appliedType(TryClass.toType, List(definitions.AnyTpe)) val NonFatalClass = rootMirror.staticModule("scala.util.control.NonFatal") val Async_await = asyncBase.awaitMethod(global)(macroApplication.symbol).ensuring(_ != NoSymbol) } |