From 44953dcb08fc5dd92e423a56bd42bcc32757aaef Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 10 Oct 2014 01:52:26 +0200 Subject: 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. --- test/files/neg/t8849.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/files/neg/t8849.scala (limited to 'test/files/neg/t8849.scala') 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 -- cgit v1.2.3