summaryrefslogtreecommitdiff
path: root/src/interactive
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-12-13 11:14:25 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-12-13 11:14:25 -0800
commitf8b56c86a4625e032198b5104e71be7a4d101fab (patch)
tree8f264815c20e5021ad202bc77c6192a7f82de636 /src/interactive
parentf1131b60a2f8cd4cafc42073ee1f2f4bdd0c983d (diff)
parent760df9843a910d6c3618e490c752eb03fb6924bd (diff)
downloadscala-f8b56c86a4625e032198b5104e71be7a4d101fab.tar.gz
scala-f8b56c86a4625e032198b5104e71be7a4d101fab.tar.bz2
scala-f8b56c86a4625e032198b5104e71be7a4d101fab.zip
Merge pull request #3262 from densh/si/8030
SI-8030 force symbols on presentation compiler initialization
Diffstat (limited to 'src/interactive')
-rw-r--r--src/interactive/scala/tools/nsc/interactive/Global.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Global.scala b/src/interactive/scala/tools/nsc/interactive/Global.scala
index 92c69dfcde..27f10ff00a 100644
--- a/src/interactive/scala/tools/nsc/interactive/Global.scala
+++ b/src/interactive/scala/tools/nsc/interactive/Global.scala
@@ -1238,6 +1238,18 @@ class Global(settings: Settings, _reporter: Reporter, projectName: String = "")
}
}
+ // We need to force a number of symbols that might be touched by a parser.
+ // Otherwise thread safety property of parseTree method would be violated.
+ protected def forceSymbolsUsedByParser(): Unit = {
+ val symbols =
+ Set(UnitClass, BooleanClass, ByteClass,
+ ShortClass, IntClass, LongClass, FloatClass,
+ DoubleClass, NilModule, ListClass) ++ TupleClass.seq
+ symbols.foreach(_.initialize)
+ }
+
+ forceSymbolsUsedByParser()
+
/** The compiler has been initialized. Constructors are evaluated in textual order,
* so this is set to true only after all super constructors and the primary constructor
* have been executed.