diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-20 13:14:49 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-20 13:14:49 -0700 |
commit | 68c6ba7e59befa88b2f383dd7eca71a9329a8b6d (patch) | |
tree | c5f8b31d94c14feda19063fbe123ce4a411d27ca | |
parent | 5ea05721047be998d1b5aaa5e8c92d5cc31fd55a (diff) | |
parent | f93c4c906994d17cd62083d1431dca35f7da74bf (diff) | |
download | scala-68c6ba7e59befa88b2f383dd7eca71a9329a8b6d.tar.gz scala-68c6ba7e59befa88b2f383dd7eca71a9329a8b6d.tar.bz2 scala-68c6ba7e59befa88b2f383dd7eca71a9329a8b6d.zip |
Merge pull request #2361 from retronym/ticket/7337
SI-7337 Error out on missing -d directory.
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/MutableSettings.scala | 3 | ||||
-rw-r--r-- | test/files/run/t7337.check | 1 | ||||
-rw-r--r-- | test/files/run/t7337.scala | 19 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala index 4d086e787e..cd23ad74e4 100644 --- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala @@ -251,8 +251,7 @@ class MutableSettings(val errorFn: String => Unit) else if (allowJar && dir == null && Jar.isJarOrZip(name, examineFile = false)) new PlainFile(Path(name)) else -// throw new FatalError(name + " does not exist or is not a directory") - dir + throw new FatalError(name + " does not exist or is not a directory") ) /** Set the single output directory. From now on, all files will diff --git a/test/files/run/t7337.check b/test/files/run/t7337.check new file mode 100644 index 0000000000..dd2b31f23c --- /dev/null +++ b/test/files/run/t7337.check @@ -0,0 +1 @@ +doesnotexist does not exist or is not a directory diff --git a/test/files/run/t7337.scala b/test/files/run/t7337.scala new file mode 100644 index 0000000000..d878182ed0 --- /dev/null +++ b/test/files/run/t7337.scala @@ -0,0 +1,19 @@ +import scala.tools.partest._ +import scala.tools.nsc._ +import util.{CommandLineParser} + +object Test extends DirectTest { + override def code = "class C" + override def newCompiler(args: String*): Global = { + val settings = newSettings((CommandLineParser tokenize ("-d doesnotexist " + extraSettings)) ++ args.toList) + newCompiler(settings) + } + + override def show() { + try { + newCompiler() + } catch { + case fe: FatalError => println(fe.getMessage) + } + } +} |