summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompilerCommand.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-02-09 14:35:15 +0000
committerPaul Phillips <paulp@improving.org>2009-02-09 14:35:15 +0000
commit3811981e422bc0d2ccba4f6b3455e0aa5c59f82f (patch)
treec4b3dc61409a8b0a7f04f9a159ea65be66e01156 /src/compiler/scala/tools/nsc/CompilerCommand.scala
parenta6340e3280a6e526b5b7ca5b2b9ed144f47fe29c (diff)
downloadscala-3811981e422bc0d2ccba4f6b3455e0aa5c59f82f.tar.gz
scala-3811981e422bc0d2ccba4f6b3455e0aa5c59f82f.tar.bz2
scala-3811981e422bc0d2ccba4f6b3455e0aa5c59f82f.zip
repaired init order issue with the fix for #1602.
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompilerCommand.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompilerCommand.scala18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala
index 1c1d17a638..c5c7f84434 100644
--- a/src/compiler/scala/tools/nsc/CompilerCommand.scala
+++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala
@@ -8,8 +8,15 @@ package scala.tools.nsc
/** A class representing command line info for scalac */
-class CompilerCommand(arguments: List[String], val settings: Settings,
- error: String => Unit, interactive: Boolean) {
+class CompilerCommand(
+ arguments: List[String],
+ val settings: Settings,
+ error: String => Unit,
+ interactive: Boolean,
+ shouldProcessArguments: Boolean)
+{
+ def this(arguments: List[String], settings: Settings, error: String => Unit, interactive: Boolean) =
+ this(arguments, settings, error, interactive, true)
private var fs: List[String] = List()
@@ -144,9 +151,10 @@ class CompilerCommand(arguments: List[String], val settings: Settings,
ok &&= settings.checkDependencies
}
- // setting up a hook so GenericRunnerCommand (at least) can see processArguments
- // run after this constructor completes, but without seeing it run twice
- val shouldProcessArguments = true
+ // CompilerCommand needs processArguments called at the end of its constructor,
+ // as does its subclass GenericRunnerCommand, but it cannot be called twice as it
+ // accumulates arguments. The fact that it's called from within the constructors
+ // makes initialization order an obstacle to simplicity.
if (shouldProcessArguments)
processArguments()
}