diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-10 15:01:13 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-10 15:01:13 +0000 |
commit | 28e6744e2305f523d16458a9d8c748903e33aca5 (patch) | |
tree | 23ecfffb8c26dcb509e1bff21580b7dbf9403af3 /src/compiler/scala/tools/nsc/interpreter/IMain.scala | |
parent | 68808e80c4574e419a440c31d24ad206870e28b3 (diff) | |
download | scala-28e6744e2305f523d16458a9d8c748903e33aca5.tar.gz scala-28e6744e2305f523d16458a9d8c748903e33aca5.tar.bz2 scala-28e6744e2305f523d16458a9d8c748903e33aca5.zip |
A somewhat more realistic attempt to fix the bu...
A somewhat more realistic attempt to fix the build, no review. This
introduces a repl command line option -Yrepl-sync to inhibit the
asynchronous path which makes repl startup seem so snappy. And then it
uses it in the repl tests.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/IMain.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/IMain.scala | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala index f39cbd0d14..5c8679a93c 100644 --- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala +++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala @@ -128,18 +128,25 @@ class IMain(val settings: Settings, protected val out: JPrintWriter) extends Imp result } } + def initializeSynchronous(): Unit = { + if (!isInitializeComplete) + _initialize() + } def isInitializeComplete = _initializeComplete /** the public, go through the future compiler */ lazy val global: Global = { - // If init hasn't been called yet you're on your own. - if (_isInitialized == null) { - repldbg("Warning: compiler accessed before init set up. Assuming no postInit code.") - initialize(()) + if (isInitializeComplete) _compiler + else { + // If init hasn't been called yet you're on your own. + if (_isInitialized == null) { + repldbg("Warning: compiler accessed before init set up. Assuming no postInit code.") + initialize(()) + } + // blocks until it is ; false means catastrophic failure + if (_isInitialized()) _compiler + else null } - // blocks until it is ; false means catastrophic failure - if (_isInitialized()) _compiler - else null } @deprecated("Use `global` for access to the compiler instance.", "2.9.0") lazy val compiler: global.type = global |