summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-04-04 22:26:41 +0000
committerpaltherr <paltherr@epfl.ch>2004-04-04 22:26:41 +0000
commit50273683038b23a2e2ae3fb5dfc02ce6f682c4b7 (patch)
treeeef9eb547ee381c68c6f668eac6a93fe69775dd1 /sources
parent5f69afd077a95e2e3d1f9f0eefa4800b7286ffda (diff)
downloadscala-50273683038b23a2e2ae3fb5dfc02ce6f682c4b7.tar.gz
scala-50273683038b23a2e2ae3fb5dfc02ce6f682c4b7.tar.bz2
scala-50273683038b23a2e2ae3fb5dfc02ce6f682c4b7.zip
- Removed Symbol.ERROR and Kinds.ERROR
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/scalac/typechecker/Infer.scala2
-rw-r--r--sources/scalac/symtab/Kinds.java4
-rw-r--r--sources/scalac/symtab/Symbol.java47
-rw-r--r--sources/scalac/symtab/SymbolTablePrinter.java3
-rw-r--r--sources/scalac/util/Debug.java8
5 files changed, 3 insertions, 61 deletions
diff --git a/sources/scala/tools/scalac/typechecker/Infer.scala b/sources/scala/tools/scalac/typechecker/Infer.scala
index 02b98f6e01..ab69716ad2 100644
--- a/sources/scala/tools/scalac/typechecker/Infer.scala
+++ b/sources/scala/tools/scalac/typechecker/Infer.scala
@@ -112,8 +112,6 @@ class Infer(global: scalac_Global, gen: TreeGen, make: TreeFactory) extends scal
/** Compute variance of type parameter `tparam' in type of symbol `sym'.
*/
private def variance(tparam: Symbol, sym: Symbol): int = sym.kind match {
- case ERROR =>
- VARIANCES
case VAL =>
variance(tparam, sym.info())
case TYPE =>
diff --git a/sources/scalac/symtab/Kinds.java b/sources/scalac/symtab/Kinds.java
index 8902ff4699..b99c8fa8d0 100644
--- a/sources/scalac/symtab/Kinds.java
+++ b/sources/scalac/symtab/Kinds.java
@@ -11,10 +11,6 @@ package scalac.symtab;
public interface Kinds {
- /** kind of error symbol
- */
- int ERROR = 0;
-
/** kind of non-existent symbol
*/
int NONE = 1;
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index fccd84c12d..c0aeecaa8f 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -31,9 +31,6 @@ public abstract class Symbol implements Modifiers, Kinds {
/** An empty array of symbol arrays */
public static final Symbol[][] EMPTY_ARRAY_ARRAY = new Symbol[0][];
- /** The error symbol */
- public static final Symbol ERROR = new ErrorSymbol();
-
/** The absent symbol */
public static final Symbol NONE = new NoSymbol();
@@ -1949,50 +1946,6 @@ public final class ClassSymbol extends TypeSymbol {
}
-/** A class for error symbols.
- */
-final class ErrorSymbol extends Symbol {
-
- /** Constructor */
- public ErrorSymbol() {
- super(Kinds.ERROR, Position.NOPOS, Names.ERROR, null, 0, IS_ERROR);
- super.setInfo(Type.ErrorType);
- }
-
- /** Set type */
- public Symbol setInfo(Type info) {
- assert info == Type.ErrorType : info;
- return this;
- }
-
- /** Get primary constructor */
- public Symbol primaryConstructor() {
- return newConstructor(pos, 0).setInfo(Type.ErrorType);
- }
-
- /** Return the next enclosing class */
- public Symbol enclClass() {
- return this;
- }
-
- /** Return the next enclosing method */
- public Symbol enclMethod() {
- return this;
- }
-
- public Type loBound() {
- return Type.ErrorType;
- }
-
- public void reset(Type completer) {
- }
-
- protected Symbol cloneSymbolImpl(Symbol owner, int attrs) {
- throw Debug.abort("illegal clone", this);
- }
-
-}
-
/** The class of Symbol.NONE
*/
final class NoSymbol extends Symbol {
diff --git a/sources/scalac/symtab/SymbolTablePrinter.java b/sources/scalac/symtab/SymbolTablePrinter.java
index 3c30ad34ba..d70d62d3c2 100644
--- a/sources/scalac/symtab/SymbolTablePrinter.java
+++ b/sources/scalac/symtab/SymbolTablePrinter.java
@@ -247,7 +247,6 @@ public class SymbolTablePrinter {
*/
public String getSymbolKind(Symbol symbol) {
switch (symbol.kind) {
- case Kinds.ERROR:
case Kinds.NONE:
return null;
case Kinds.CLASS:
@@ -279,7 +278,6 @@ public class SymbolTablePrinter {
public String getSymbolKeyword(Symbol symbol) {
if (symbol.isParameter()) return null;
switch (symbol.kind) {
- case Kinds.ERROR:
case Kinds.NONE:
return null;
case Kinds.CLASS:
@@ -309,7 +307,6 @@ public class SymbolTablePrinter {
/** Returns the inner string of the given symbol. */
public String getSymbolInnerString(Symbol symbol) {
switch (symbol.kind) {
- case Kinds.ERROR: return ":";
case Kinds.NONE : return ":";
case Kinds.ALIAS: return "=";
case Kinds.CLASS: return "extends";
diff --git a/sources/scalac/util/Debug.java b/sources/scalac/util/Debug.java
index 6ecbdb66cd..efa1cab58f 100644
--- a/sources/scalac/util/Debug.java
+++ b/sources/scalac/util/Debug.java
@@ -484,11 +484,9 @@ public class DebugSymbol extends DebugAbstractHandler {
public static DebugSymbol instance = new DebugSymbol();
public void append1(StringBuffer buffer, Symbol that) {
- if (that != Symbol.NONE && that != Symbol.ERROR) {
- if (!that.owner().isRoot() && !that.isRoot()) {
- Debug.append(buffer, that.owner());
- buffer.append(".");
- }
+ if (!that.isNone() && !that.owner().isRoot() && !that.isRoot()) {
+ Debug.append(buffer, that.owner());
+ buffer.append(".");
}
buffer.append(that.name);
if (Global.instance.uniqid) {