summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-03-10 03:19:09 +0000
committerpaltherr <paltherr@epfl.ch>2004-03-10 03:19:09 +0000
commit982187f1d304c9545faa48039e21f4e4ecc08101 (patch)
tree59959a8c0e9cf071e94858f23b03a1669fac6432 /sources
parent98bd45db839f0ec470d1fdbd42d5c748e428f4b5 (diff)
downloadscala-982187f1d304c9545faa48039e21f4e4ecc08101.tar.gz
scala-982187f1d304c9545faa48039e21f4e4ecc08101.tar.bz2
scala-982187f1d304c9545faa48039e21f4e4ecc08101.zip
- Simplified some type initializations
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/classfile/CLRClassParser.java17
-rw-r--r--sources/scalac/symtab/classfile/ClassfileParser.java20
2 files changed, 16 insertions, 21 deletions
diff --git a/sources/scalac/symtab/classfile/CLRClassParser.java b/sources/scalac/symtab/classfile/CLRClassParser.java
index 7136b1f90f..51b156b461 100644
--- a/sources/scalac/symtab/classfile/CLRClassParser.java
+++ b/sources/scalac/symtab/classfile/CLRClassParser.java
@@ -67,18 +67,15 @@ public class CLRClassParser extends SymbolLoader {
baseTypes[i + 1] = getCLRType(ifaces[i]);
Scope members = new Scope();
Scope statics = new Scope();
- scalac.symtab.Type classType =
+ scalac.symtab.Type classInfo =
scalac.symtab.Type.compoundType(baseTypes, members, clazz);
- clazz.setInfo(classType);
+ clazz.setInfo(classInfo);
Symbol staticsClass = clazz.dualClass();
- if (staticsClass.isModuleClass()) {
- scalac.symtab.Type staticsInfo = scalac.symtab.Type.compoundType
- (scalac.symtab.Type.EMPTY_ARRAY, statics, staticsClass);
- staticsClass.setInfo(staticsInfo);
- staticsClass.module().setInfo(scalac.symtab.Type.typeRef
- (staticsClass.owner().thisType(),
- staticsClass, scalac.symtab.Type.EMPTY_ARRAY));
- }
+ assert staticsClass.isModuleClass(): Debug.show(staticsClass);
+ scalac.symtab.Type staticsInfo = scalac.symtab.Type.compoundType
+ (scalac.symtab.Type.EMPTY_ARRAY, statics, staticsClass);
+ staticsClass.setInfo(staticsInfo);
+ staticsClass.module().setInfo(make.classType(staticsClass));
scalac.symtab.Type ctype = make.classType(clazz);
// import nested types
diff --git a/sources/scalac/symtab/classfile/ClassfileParser.java b/sources/scalac/symtab/classfile/ClassfileParser.java
index 3ee3f61b1e..406f79f54a 100644
--- a/sources/scalac/symtab/classfile/ClassfileParser.java
+++ b/sources/scalac/symtab/classfile/ClassfileParser.java
@@ -98,17 +98,15 @@ public class ClassfileParser implements ClassfileConstants {
Type[] basetpes = new Type[in.nextChar() + 1];
this.locals = new Scope();
this.statics = new Scope();
- // set type of class
- Type classType = Type.compoundType(basetpes, locals, c);
- c.setInfo(classType);
- // set type of statics
+ // set info of class
+ Type classInfo = Type.compoundType(basetpes, locals, c);
+ c.setInfo(classInfo);
+ // set info of statics class
Symbol staticsClass = c.dualClass();
- if (staticsClass.isModuleClass()) {
- Type staticsInfo = Type.compoundType(Type.EMPTY_ARRAY, statics, staticsClass);
- staticsClass.setInfo(staticsInfo);
- staticsClass.module().setInfo(Type.typeRef(staticsClass.owner().thisType(),
- staticsClass, Type.EMPTY_ARRAY));
- }
+ assert staticsClass.isModuleClass(): Debug.show(staticsClass);
+ Type staticsInfo = Type.compoundType(Type.EMPTY_ARRAY, statics, staticsClass);
+ staticsClass.setInfo(staticsInfo);
+ staticsClass.module().setInfo(make.classType(staticsClass));
basetpes[0] = supertpe;
for (int i = 1; i < basetpes.length; i++)
basetpes[i] = readClassType(in.nextChar());
@@ -126,7 +124,7 @@ public class ClassfileParser implements ClassfileConstants {
if ((c.flags & Modifiers.INTERFACE) == 0)
constr.flags |= Modifiers.PRIVATE;
}
- attrib.readAttributes(c, classType, CLASS_ATTR);
+ attrib.readAttributes(c, classInfo, CLASS_ATTR);
//System.out.println("dynamic class: " + c);
//System.out.println("statics class: " + staticsClass);
//System.out.println("module: " + c.module());