diff options
author | Martin Odersky <odersky@gmail.com> | 2006-11-27 11:55:52 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-11-27 11:55:52 +0000 |
commit | 722d82d18a9f452bcb58b8523db14840fbb8c0d9 (patch) | |
tree | 4593ac38175619ef31b267f2e4b3b00d458263a9 | |
parent | e150c1dd7e8d0d312101bce65d0499500235d02d (diff) | |
download | scala-722d82d18a9f452bcb58b8523db14840fbb8c0d9.tar.gz scala-722d82d18a9f452bcb58b8523db14840fbb8c0d9.tar.bz2 scala-722d82d18a9f452bcb58b8523db14840fbb8c0d9.zip |
fixed bug831
fixed problem in util.ClassPath that caused fsc to die silently if
output directory does not exist.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 17 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/util/ClassPath.scala | 6 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index fa68dc4402..6f4e852530 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1862,14 +1862,15 @@ trait Types requires SymbolTable { tps1.length == tps2.length && List.forall2(tps1, tps2)((tp1, tp2) => tp1 =:= tp2) - var subtypecount = 0 - def isSubType(tp1: Type, tp2: Type): boolean = { - subtypecount = subtypecount + 1 - if (subtypecount == 20) throw new Error("recursive <:<") - val result = isSubType0(tp1, tp2) - subtypecount = subtypecount - 1 - result - } + private var stc = 0 + def isSubType(tp1: Type, tp2: Type): boolean = + try { + stc = stc + 1 + if (stc == 20) throw new Error("recursive <:<") + isSubType0(tp1, tp2) + } finally { + stc = stc - 1 + } /** Does type <code>tp1</code> conform to <code>tp2</code>? * diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index e01c577a65..af89eb1603 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -183,10 +183,8 @@ class ClassPath(onlyPresentation: Boolean) { addFilesInPath(boot) addArchivesInExtDirPath(extdirs) val clazzes = AbstractFile.getDirectory(output) - if (clazzes eq null) { - Console.err.println("Output location \"" + output + "\" not found") - exit(1) - } + if (clazzes eq null) + throw new FatalError("Output location \"" + output + "\" not found") val strtok = new StringTokenizer(source, File.pathSeparator) if (!strtok.hasMoreTokens()) { val output0 = (new Output(clazzes, null)) |