summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-03-21 11:40:21 +0000
committerMartin Odersky <odersky@gmail.com>2003-03-21 11:40:21 +0000
commite6ebbe6ab4550a542db29372e59d72a2ff90e6e3 (patch)
treec4c155d9217e1b3e1814aeb8e0541f061b67215f /sources/scalac/symtab
parent940c7755d3997238492c9e53668fc663aeef2302 (diff)
downloadscala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.tar.gz
scala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.tar.bz2
scala-e6ebbe6ab4550a542db29372e59d72a2ff90e6e3.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r--sources/scalac/symtab/Symbol.java37
1 files changed, 33 insertions, 4 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 92eca67cce..35ceb28e36 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -884,6 +884,13 @@ public abstract class Symbol implements Modifiers, Kinds {
}
}
}
+
+ public void reset(Type completer) {
+ this.flags &= (FINAL | MODUL);
+ this.pos = 0;
+ this.infos = TypeIntervalList.EMPTY;
+ this.setInfo(completer);
+ }
}
/** A class for term symbols
@@ -924,7 +931,7 @@ public class TermSymbol extends Symbol {
*/
public static TermSymbol newCompanionModule(Symbol clazz, int flags, Type.LazyType parser) {
TermSymbol sym = newModule(Position.NOPOS, clazz.name.toTermName(), clazz.owner(),
- FINAL | flags);
+ flags);
sym.clazz.setInfo(parser);
return sym;
}
@@ -946,8 +953,7 @@ public class TermSymbol extends Symbol {
}
/** Get the fully qualified name of this Symbol */
public Name fullName() {
- if (isModule()) return moduleClass().fullName();
- else if (isPrimaryConstructor()) return primaryConstructorClass().fullName();
+ if (clazz != null) return clazz.fullName();
else return super.fullName();
}
@@ -1106,6 +1112,12 @@ public class TypeSymbol extends Symbol {
adjustType(parents[i]);
}
}
+
+ public void reset(Type completer) {
+ super.reset(completer);
+ closures = ClosureIntervalList.EMPTY;
+ tycon = null;
+ }
}
/** A class for class symbols. It has JavaClassSymbol as a subclass.
@@ -1134,7 +1146,14 @@ public class ClassSymbol extends TypeSymbol {
/** A cache for this.thisType()
*/
- private Type thistp = Type.ThisType(this);
+ final private Type thistp = Type.ThisType(this);
+
+ /** The sourcefile name form where the class symbol was or
+ * needs to be loaded. only defined for Scala source library classes;
+ * not for classes that exist in class files, or classes compiled
+ * from the command line.
+ */
+ public String sourcefile = null;
/** Principal Constructor
*/
@@ -1158,6 +1177,7 @@ public class ClassSymbol extends TypeSymbol {
this.module = TermSymbol.newCompanionModule(this, 0, parser);
this.mangled = name;
this.setInfo(parser);
+ this.sourcefile = parser.filename;
}
/** Constructor for classes to load as class files.
@@ -1178,6 +1198,7 @@ public class ClassSymbol extends TypeSymbol {
other.constructor.setInfo(constructor.info());
other.mangled = mangled;
other.module = module;
+ other.sourcefile = sourcefile;
if (thisSym != this) other.setTypeOfThis(typeOfThis());
return other;
}
@@ -1279,6 +1300,14 @@ public class ClassSymbol extends TypeSymbol {
assert sym != null : this;
return sym;
}
+
+ public void reset(Type completer) {
+ super.reset(completer);
+ constructor().reset(completer);
+ module().reset(completer);
+ template = null;
+ thisSym = this;
+ }
}
/** A class for error symbols.