diff options
author | mihaylov <mihaylov@epfl.ch> | 2003-11-10 11:37:45 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2003-11-10 11:37:45 +0000 |
commit | c38b0a7fd30ba1ec03c27d66f9dc685abfbc5820 (patch) | |
tree | f77f2ab66075243b2d82d99e9be4693a7c92f95e /sources/scalac/backend | |
parent | 6ef31a05694acc71dce8fa45d1e62db47c5d9150 (diff) | |
download | scala-c38b0a7fd30ba1ec03c27d66f9dc685abfbc5820.tar.gz scala-c38b0a7fd30ba1ec03c27d66f9dc685abfbc5820.tar.bz2 scala-c38b0a7fd30ba1ec03c27d66f9dc685abfbc5820.zip |
- fixed handling of object instance fields
Diffstat (limited to 'sources/scalac/backend')
-rw-r--r-- | sources/scalac/backend/msil/TypeCreator.java | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sources/scalac/backend/msil/TypeCreator.java b/sources/scalac/backend/msil/TypeCreator.java index 6e4aaaaba9..ee164b0635 100644 --- a/sources/scalac/backend/msil/TypeCreator.java +++ b/sources/scalac/backend/msil/TypeCreator.java @@ -138,9 +138,9 @@ final class TypeCreator { MONITOR_WAIT = MONITOR.GetMethod("Wait", new Type[] {OBJECT}); MONITOR_WAIT_TIMEOUT = MONITOR.GetMethod("Wait", new Type[] {OBJECT, INT}); - Assembly.LoadFrom("/home/linuxsoft/apps/msil/vjslib.dll").GetModules(); - Assembly.LoadFrom("/home/linuxsoft/apps/msil/scala.dll").GetModules(); - Assembly.LoadFrom("/home/linuxsoft/apps/msil/scala_sc.dll").GetModules(); + Assembly.LoadFrom("/home/linuxsoft/apps/msil/vjslib.dll").GetModules(); + Assembly.LoadFrom("/home/linuxsoft/apps/msil/scala.dll").GetModules(); + Assembly.LoadFrom("/home/linuxsoft/apps/msil/scala_sc.dll").GetModules(); } private boolean initialized = false; @@ -883,28 +883,24 @@ final class TypeCreator { if (sym != s) { //log("getModuleField: going through: " + dumpSym(s)); moduleField = getModuleField(s); - } else if (sym.isExternal()){ - Type t = getType(sym); - assert !(t instanceof TypeBuilder); - moduleField = t.GetField(MODULE_S); - assert moduleField != null; } else { - Type t = getType(sym); - assert t instanceof TypeBuilder : - "Type of " + dumpSym(sym) + " is " + t; - TypeBuilder module = (TypeBuilder) t;//getType(sym); - moduleField = module.DefineField - (MODULE_S, - module, - (short)(FieldAttributes.Public - | FieldAttributes.InitOnly - | FieldAttributes.Static)); + Type type = getType(sym); + if (type instanceof TypeBuilder) { + TypeBuilder module = (TypeBuilder) type; + moduleField = module.DefineField + (MODULE_S, + module, + (short)(FieldAttributes.Public + | FieldAttributes.InitOnly + | FieldAttributes.Static)); + } else { + moduleField = type.GetField(MODULE_S); + assert moduleField != null; + } } symbols2moduleFields.put(sym, moduleField); } - } - else { - return null; + } else { //throw new ApplicationError("getModuleField: not a module: " + //dumpSym(sym)); } |