aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/Async.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-07-29 19:36:36 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-07-29 19:36:36 +1000
commit4b1dbeef9ec73612867afc5dd9c925faa8cbc30d (patch)
tree72cee6f538efa06569647c9b309483b8f911e97a /src/main/scala/scala/async/Async.scala
parent6d44255964092b672accd7784ddc712d30f1d7c4 (diff)
downloadscala-async-4b1dbeef9ec73612867afc5dd9c925faa8cbc30d.tar.gz
scala-async-4b1dbeef9ec73612867afc5dd9c925faa8cbc30d.tar.bz2
scala-async-4b1dbeef9ec73612867afc5dd9c925faa8cbc30d.zip
Avoid dead code warning with async(throw T)
By declararing the parameter of `async` as by-name. Fixes #150 (the bug in the original ticket.)
Diffstat (limited to 'src/main/scala/scala/async/Async.scala')
-rw-r--r--src/main/scala/scala/async/Async.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/scala/scala/async/Async.scala b/src/main/scala/scala/async/Async.scala
index bacf70a..0bba6ed 100644
--- a/src/main/scala/scala/async/Async.scala
+++ b/src/main/scala/scala/async/Async.scala
@@ -42,7 +42,7 @@ object Async {
* Run the block of code `body` asynchronously. `body` may contain calls to `await` when the results of
* a `Future` are needed; this is translated into non-blocking code.
*/
- def async[T](body: T)(implicit execContext: ExecutionContext): Future[T] = macro internal.ScalaConcurrentAsync.asyncImpl[T]
+ def async[T](body: => T)(implicit execContext: ExecutionContext): Future[T] = macro internal.ScalaConcurrentAsync.asyncImpl[T]
/**
* Non-blocking await the on result of `awaitable`. This may only be used directly within an enclosing `async` block.