diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-10-03 22:11:01 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-10-03 22:11:01 +0000 |
commit | 4c83b5e7d2779de15d5ec6deb8105d499d2e3f6f (patch) | |
tree | bdc69af6ca1636da1fbce50940a94f419c87b78d /sources | |
parent | a4796d889dbeb01ec015ed0fe768fccf7454b4c5 (diff) | |
download | scala-4c83b5e7d2779de15d5ec6deb8105d499d2e3f6f.tar.gz scala-4c83b5e7d2779de15d5ec6deb8105d499d2e3f6f.tar.bz2 scala-4c83b5e7d2779de15d5ec6deb8105d499d2e3f6f.zip |
Improved handling of the scala.dll assembly
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/symtab/classfile/CLRTypes.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sources/scalac/symtab/classfile/CLRTypes.java b/sources/scalac/symtab/classfile/CLRTypes.java index d14ba470ed..3ce4d8ceba 100644 --- a/sources/scalac/symtab/classfile/CLRTypes.java +++ b/sources/scalac/symtab/classfile/CLRTypes.java @@ -92,13 +92,15 @@ public final class CLRTypes { this.args = args; scala.tools.util.ClassPath.addFilesInPath( assemrefs, args.assemrefs.value); - Assembly mscorlib = findAssembly("mscorlib.dll"); + Assembly mscorlib = findAssembly("mscorlib.dll", true); Type.initMSCORLIB(mscorlib); - findAssembly("vjscor.dll"); - findAssembly("vjslib.dll"); - findAssembly("scala.dll"); + findAssembly("scala.dll", false); findAllAssemblies(); + if (getType("scala.Int") == null) { + abort("scala.dll"); + } + BYTE = getType("System.SByte"); UBYTE = getType("System.Byte"); CHAR = getType("System.Char"); @@ -211,7 +213,7 @@ public final class CLRTypes { /** Load the assembly with the given name */ - private Assembly findAssembly(String name) { + private Assembly findAssembly(String name, boolean required) { // see if the assembly is referenced directly for (Iterator assems = assemrefs.iterator(); assems.hasNext();) { File file = (File)assems.next(); @@ -247,10 +249,11 @@ public final class CLRTypes { return assem; } } - //the Global instance is not yet constructed; use the Reporter from args - args.reporter().error(null, "cannot find assembly " + name + - "; use the -r option to specify its location"); - throw Debug.abort(); + + if (required) + abort(name); + + return null; } /** Load the rest of the assemblies specified with the '-r' option @@ -269,6 +272,13 @@ public final class CLRTypes { assert assemrefs.isEmpty(); } + private void abort(String name) { + //the Global instance is not yet constructed; use the Reporter from args + args.reporter().error(null, "cannot find assembly " + name + + "; use the -r option to specify its location"); + throw Debug.abort(); + } + //########################################################################## // collect the members contained in a given namespace |