diff options
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. |