diff options
author | paltherr <paltherr@epfl.ch> | 2004-02-29 14:07:12 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-02-29 14:07:12 +0000 |
commit | 826af8cfd01774c4545ea72c6a415693c5205378 (patch) | |
tree | f32b4467532b656f590eb8728c7fc361586759bd | |
parent | 05632168c11408adbafab7dcfb165c9e901bc97d (diff) | |
download | scala-826af8cfd01774c4545ea72c6a415693c5205378.tar.gz scala-826af8cfd01774c4545ea72c6a415693c5205378.tar.bz2 scala-826af8cfd01774c4545ea72c6a415693c5205378.zip |
- Removed method SymbolTablePrinter.getSymbolFu...
- Removed method SymbolTablePrinter.getSymbolFullName -
Removed method SymbolTablePrinter.printSymbolFullName -
Replaced method SymbolTablePrinter.printSymbol by method
SymbolTablePrinter.printSymbolKindAndName
-rw-r--r-- | sources/scalac/Global.java | 8 | ||||
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 2 | ||||
-rw-r--r-- | sources/scalac/symtab/SymbolTablePrinter.java | 34 | ||||
-rw-r--r-- | sources/scalac/transformer/Erasure.java | 2 | ||||
-rw-r--r-- | test/files/neg/S7.check | 2 | ||||
-rw-r--r-- | test/files/neg/bug228.check | 2 | ||||
-rw-r--r-- | test/files/neg/bug72.check | 2 | ||||
-rw-r--r-- | test/files/neg/bug97.check | 2 |
8 files changed, 16 insertions, 38 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index dd2d8ba4cf..bf43080129 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -515,14 +515,6 @@ public abstract class Global { } return string; } - public String getSymbolFullName(Symbol symbol) { - String string = super.getSymbolFullName(symbol); - if (!debug) { - int index = string.indexOf('$'); - if (index > 0) string = string.substring(0, index); - } - return string; - } } // !!! >>> Interpreter stuff diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 5e7d11b62b..321b49459a 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -1110,7 +1110,7 @@ public abstract class Symbol implements Modifiers, Kinds { * e.g., "class Foo", "function Bar". */ public String toString() { - return new SymbolTablePrinter().printSymbol(this).toString(); + return new SymbolTablePrinter().printSymbolKindAndName(this).toString(); } /** String representation of location. diff --git a/sources/scalac/symtab/SymbolTablePrinter.java b/sources/scalac/symtab/SymbolTablePrinter.java index a1957bbcad..83b45f9491 100644 --- a/sources/scalac/symtab/SymbolTablePrinter.java +++ b/sources/scalac/symtab/SymbolTablePrinter.java @@ -303,13 +303,6 @@ public class SymbolTablePrinter { return name; } - /** Returns the full name of the given symbol. */ - public String getSymbolFullName(Symbol symbol) { - String name = symbol.fullName().toString(); - if (!global.debug) name = NameTransformer.decode(name); - return name; - } - /** Returns the inner string of the given symbol. */ public String getSymbolInnerString(Symbol symbol) { switch (symbol.kind) { @@ -335,11 +328,16 @@ public class SymbolTablePrinter { return printSymbolUniqueId(symbol); } - /** Prints the full name of the given symbol */ - public SymbolTablePrinter printSymbolFullName(Symbol symbol) { - print(getSymbolFullName(symbol)); - //print("{" + symbol.owner() + "}");//DEBUG - return printSymbolUniqueId(symbol); + /** Prints the kind and the name of the given symbol. */ + public SymbolTablePrinter printSymbolKindAndName(Symbol symbol) { + if (symbol.isAnonymousClass()) { + print("<template>"); + return printSymbolUniqueId(symbol); + } else { + String kind = getSymbolKind(symbol); + if (kind != null) print(kind).space(); + return printSymbolName(symbol); + } } /** Prints the type of the given symbol with the given inner string. */ @@ -359,18 +357,6 @@ public class SymbolTablePrinter { return this; } - /** Prints the given symbol. */ - public SymbolTablePrinter printSymbol(Symbol symbol) { - if (symbol.isAnonymousClass()) { - print("<template>"); - return printSymbolUniqueId(symbol); - } else { - String kind = getSymbolKind(symbol); - if (kind != null) print(kind).space(); - return printSymbolFullName(symbol); - } - } - /** Prints the signature of the given symbol. */ public SymbolTablePrinter printSignature(Symbol symbol) { String keyword = getSymbolKeyword(symbol); diff --git a/sources/scalac/transformer/Erasure.java b/sources/scalac/transformer/Erasure.java index 5da45dd2c5..a941296e4d 100644 --- a/sources/scalac/transformer/Erasure.java +++ b/sources/scalac/transformer/Erasure.java @@ -592,7 +592,7 @@ public class Erasure extends GenTransformer implements Modifiers { SymbolTablePrinter printer = new SymbolTablePrinter(" "); printer.print("overlapping overloaded alternatives;").space(); printer.print("the two following alternatives of").space(); - printer.printSymbol(symbol1).space(); + printer.printSymbolKindAndName(symbol1).space(); printer.print("have the same erasure:").space(); printer.printType(symbol1.nextType()); Phase phase = global.currentPhase; diff --git a/test/files/neg/S7.check b/test/files/neg/S7.check index c12c624cd7..2246e48d84 100644 --- a/test/files/neg/S7.check +++ b/test/files/neg/S7.check @@ -1,4 +1,4 @@ -S7.scala:6: illegal cyclic reference involving class S7.A +S7.scala:6: illegal cyclic reference involving class A class C() extends a.A() {} ^ one error found diff --git a/test/files/neg/bug228.check b/test/files/neg/bug228.check index a099f9fa0e..92651e61f7 100644 --- a/test/files/neg/bug228.check +++ b/test/files/neg/bug228.check @@ -1,4 +1,4 @@ -bug228.scala:11: constructor java.lang.reflect.AccessibleObject cannot be accessed in Foo +bug228.scala:11: constructor AccessibleObject cannot be accessed in Foo val o = new AccessibleObject; ^ one error found diff --git a/test/files/neg/bug72.check b/test/files/neg/bug72.check index 5338fcc2c6..0b427069f2 100644 --- a/test/files/neg/bug72.check +++ b/test/files/neg/bug72.check @@ -1,4 +1,4 @@ -bug72.scala:5: object scala.collection.mutable.Set of type scala.collection.mutable.Set cannot be applied to (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) with expected result type scala.collection.mutable.Set[java.lang.String] +bug72.scala:5: object Set of type scala.collection.mutable.Set cannot be applied to (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) with expected result type scala.collection.mutable.Set[java.lang.String] val weekDays : Set[String] = Set("Mon", "Tue", "Wed", "Thu", "Fri"); ^ one error found diff --git a/test/files/neg/bug97.check b/test/files/neg/bug97.check index cc620b3650..a7c52ff78e 100644 --- a/test/files/neg/bug97.check +++ b/test/files/neg/bug97.check @@ -1,4 +1,4 @@ -bug97.scala:3: expected pattern type scala.Any does not conform to sequence trait scala.List +bug97.scala:3: expected pattern type scala.Any does not conform to sequence trait List case List(y) => "zero" ^ one error found |