summaryrefslogtreecommitdiff
path: root/src/library/scala/concurrent/ExecutionContext.scala
diff options
context:
space:
mode:
authorViktor Klang <viktor.klang@gmail.com>2014-10-10 01:52:26 +0200
committerViktor Klang <viktor.klang@gmail.com>2014-10-20 23:55:49 +0200
commit44953dcb08fc5dd92e423a56bd42bcc32757aaef (patch)
tree416f3877b1bdc849d0e67383d68b3dceee2ac11c /src/library/scala/concurrent/ExecutionContext.scala
parentfa0743c32338f147eaf7a5d69566bbc15d193f85 (diff)
downloadscala-44953dcb08fc5dd92e423a56bd42bcc32757aaef.tar.gz
scala-44953dcb08fc5dd92e423a56bd42bcc32757aaef.tar.bz2
scala-44953dcb08fc5dd92e423a56bd42bcc32757aaef.zip
SI-8849 Makes `ExecutionContext.Implicits.global` ambiguous
There was an unfortunate side-effect from having `Implicits.global` be of type `ExecutionContextExecutor`; it is more specific than `ExecutionContext`, as such it would be picked over other `ExecutionContexts` in the implicit scope.
Diffstat (limited to 'src/library/scala/concurrent/ExecutionContext.scala')
-rw-r--r--src/library/scala/concurrent/ExecutionContext.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/concurrent/ExecutionContext.scala b/src/library/scala/concurrent/ExecutionContext.scala
index 0bb96b5b30..d728a7f97a 100644
--- a/src/library/scala/concurrent/ExecutionContext.scala
+++ b/src/library/scala/concurrent/ExecutionContext.scala
@@ -117,7 +117,7 @@ object ExecutionContext {
*
* @return the global `ExecutionContext`
*/
- def global: ExecutionContextExecutor = Implicits.global
+ def global: ExecutionContextExecutor = Implicits.global.asInstanceOf[ExecutionContextExecutor]
object Implicits {
/**
@@ -127,7 +127,7 @@ object ExecutionContext {
* The default `ExecutionContext` implementation is backed by a port of
* [[http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166-4jdk7docs/java/util/concurrent/ForkJoinPool.html java.util.concurrent.ForkJoinPool]].
*/
- implicit lazy val global: ExecutionContextExecutor = impl.ExecutionContextImpl.fromExecutor(null: Executor)
+ implicit lazy val global: ExecutionContext = impl.ExecutionContextImpl.fromExecutor(null: Executor)
}
/** Creates an `ExecutionContext` from the given `ExecutorService`.