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 /test/files/neg/t8849.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 'test/files/neg/t8849.scala')
-rw-r--r-- | test/files/neg/t8849.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/t8849.scala b/test/files/neg/t8849.scala new file mode 100644 index 0000000000..336f16b40f --- /dev/null +++ b/test/files/neg/t8849.scala @@ -0,0 +1,10 @@ +import scala.concurrent.ExecutionContext +import ExecutionContext.Implicits.global + +object Test { + def main(args: Array[String]): Unit = { + implicit val dummy: ExecutionContext = null + require(scala.concurrent.ExecutionContext.Implicits.global ne null) + require(implicitly[ExecutionContext] eq dummy) + } +}
\ No newline at end of file |