From da852d8ff2f8e0a86a0eb7fe2fdb0f12ec7bbc12 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Tue, 20 Jul 2004 16:41:17 +0000 Subject: - Hard-coded the symbols of java.lang.Object an... - Hard-coded the symbols of java.lang.Object and java.lang.String --- sources/scalac/symtab/classfile/Signatures.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sources/scalac/symtab/classfile/Signatures.java b/sources/scalac/symtab/classfile/Signatures.java index 3ac965ab03..408a3e9384 100644 --- a/sources/scalac/symtab/classfile/Signatures.java +++ b/sources/scalac/symtab/classfile/Signatures.java @@ -14,7 +14,9 @@ import scalac.symtab.Symbol; import scalac.symtab.Type; import scalac.util.AbstractFileReader; import scalac.util.Name; +import scalac.util.Names; import scalac.util.SourceRepresentation; +import scalac.util.Debug; /** This class implements the parsing of class file signatures. */ public class Signatures { @@ -91,11 +93,23 @@ public class Signatures { owner = module.moduleClass(); start = current + 1; } - Name name = Name.fromAscii(in.buf, start, current-start).toTypeName(); - Symbol clasz = owner.members().lookup(name); + + Symbol clasz = null; + Name name = Name.fromAscii(in.buf, start, current-start); + if (owner == global.definitions.JAVALANG.moduleClass()) { + if (name == Names.String) + clasz = global.definitions.STRING_CLASS; + else if (name == Names.Object) + clasz = global.definitions.OBJECT_CLASS; + } + if (clasz == null) { + name = name.toTypeName(); + clasz = owner.members().lookup(name); + } + if (!clasz.isClass()) { Symbol symbol = owner.newErrorClass(name); - error("could not find class " + symbol.staticType()); + error("could not find class " + symbol.staticType() + "(found " + Debug.show(clasz) + ")"); if (clasz.isNone()) owner.members().enterNoHide(symbol); clasz = symbol; } -- cgit v1.2.3