summaryrefslogtreecommitdiff
path: root/src/library/scala/concurrent/forkjoin/package.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-12-14 08:35:49 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-12-14 09:34:28 +1000
commit64a0ec47092a1310e746b401837c61cefc591faa (patch)
tree6d36154928da33a7698d0e05432af7d68133e033 /src/library/scala/concurrent/forkjoin/package.scala
parent4c0a9f13e4c2d1669571d76645e180f60307f70f (diff)
downloadscala-64a0ec47092a1310e746b401837c61cefc591faa.tar.gz
scala-64a0ec47092a1310e746b401837c61cefc591faa.tar.bz2
scala-64a0ec47092a1310e746b401837c61cefc591faa.zip
Modules w. serializable type alias "companions" are not serializable
The behaviour changed in #5550, this commit adapts to the change so that we'll be binary compatible after boostrapping. MiMa alerted us to a change in the parentage of two objects in the forkjoin package object. In Scala 2.12.0/1, they implemented `scala.Serializable`. Recently, this (synthetically added) parent was absent. This appears to be due to a bug fix in `companionSymbolOf`, which no longer treats objects and same-named type aliases to be companions. This commit manually adds the formerly-synthetic parents to these objects, and documents the change in compiler behaviour with a test. Fixes scala/scala-dev#290
Diffstat (limited to 'src/library/scala/concurrent/forkjoin/package.scala')
-rw-r--r--src/library/scala/concurrent/forkjoin/package.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/concurrent/forkjoin/package.scala b/src/library/scala/concurrent/forkjoin/package.scala
index 1915e25d7b..889890e30b 100644
--- a/src/library/scala/concurrent/forkjoin/package.scala
+++ b/src/library/scala/concurrent/forkjoin/package.scala
@@ -25,7 +25,7 @@ package object forkjoin {
@deprecated("use java.util.concurrent.ForkJoinTask directly, instead of this alias", "2.12.0")
type ForkJoinTask[T] = juc.ForkJoinTask[T]
@deprecated("use java.util.concurrent.ForkJoinTask directly, instead of this alias", "2.12.0")
- object ForkJoinTask {
+ object ForkJoinTask extends scala.Serializable {
def adapt(runnable: Runnable): ForkJoinTask[_] = juc.ForkJoinTask.adapt(runnable)
def adapt[T](callable: juc.Callable[_ <: T]): ForkJoinTask[T] = juc.ForkJoinTask.adapt(callable)
def adapt[T](runnable: Runnable, result: T): ForkJoinTask[T] = juc.ForkJoinTask.adapt(runnable, result)
@@ -51,7 +51,7 @@ package object forkjoin {
@deprecated("use java.util.concurrent.ThreadLocalRandom directly, instead of this alias", "2.12.0")
type ThreadLocalRandom = juc.ThreadLocalRandom
@deprecated("use java.util.concurrent.ThreadLocalRandom directly, instead of this alias", "2.12.0")
- object ThreadLocalRandom {
+ object ThreadLocalRandom extends scala.Serializable {
// For source compatibility, current must declare the empty argument list.
// Having no argument list makes more sense since it doesn't have any side effects,
// but existing callers will break if they invoked it as `current()`.