summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2016-07-26 18:21:48 +0200
committerStefan Zeiger <szeiger@novocode.com>2016-08-12 13:41:31 +0200
commit4c2c4c17bedb0627f6caaa44b0ab4c58a8949b71 (patch)
treea5c8b86849b49a195a6e8a22a27139869812a312 /src/repl
parent1e7ce6e774f2428356887d71870557b67062ef7f (diff)
downloadscala-4c2c4c17bedb0627f6caaa44b0ab4c58a8949b71.tar.gz
scala-4c2c4c17bedb0627f6caaa44b0ab4c58a8949b71.tar.bz2
scala-4c2c4c17bedb0627f6caaa44b0ab4c58a8949b71.zip
SI-8576 Minimal changes for `-Xcheckinit` compatibility
As explained in https://issues.scala-lang.org/browse/SI-8576, I expect serialization compatibility between builds with and without `-Xcheckinit` to be unattainable. This commit contains some minor fixes for issues discovered while running builds with `-Xcheckinit`: - Add `@SerialVersionUID` to `scala.collection.immutable.Vector`, as requested in SI-8576. Note that this does not make `Vector` serialization compatible. - Use lazy initialization for `global` in `PresentationCompilation`. It used to access the uninitialized `self` variable (which seems to be inconsequential in practice and only fails under `-Xcheckinit`). We should consider using `Externalizable` instead of `Serializable` for collections in 2.13 to make collection classes serialization compatible.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala b/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala
index b9a4054ffc..d675563bc9 100644
--- a/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala
+++ b/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala
@@ -69,7 +69,7 @@ trait PresentationCompilation {
val interactiveGlobal = new interactive.Global(copySettings, storeReporter) { self =>
override lazy val platform: ThisPlatform = {
new JavaPlatform {
- val global: self.type = self
+ lazy val global: self.type = self
override private[nsc] lazy val classPath: ClassPath = mergedFlatClasspath
}
}