diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 11:14:25 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 11:14:25 -0800 |
commit | f8b56c86a4625e032198b5104e71be7a4d101fab (patch) | |
tree | 8f264815c20e5021ad202bc77c6192a7f82de636 /src/interactive/scala/tools | |
parent | f1131b60a2f8cd4cafc42073ee1f2f4bdd0c983d (diff) | |
parent | 760df9843a910d6c3618e490c752eb03fb6924bd (diff) | |
download | scala-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/scala/tools')
-rw-r--r-- | src/interactive/scala/tools/nsc/interactive/Global.scala | 12 |
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. |