diff options
author | Viktor Klang <viktor.klang@gmail.com> | 2014-10-10 01:52:26 +0200 |
---|---|---|
committer | Viktor Klang <viktor.klang@gmail.com> | 2014-10-20 23:55:49 +0200 |
commit | 44953dcb08fc5dd92e423a56bd42bcc32757aaef (patch) | |
tree | 416f3877b1bdc849d0e67383d68b3dceee2ac11c /src/library/scala/concurrent/ExecutionContext.scala | |
parent | fa0743c32338f147eaf7a5d69566bbc15d193f85 (diff) | |
download | scala-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.scala | 4 |
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`. |