summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-08-21 10:41:22 +0000
committerMartin Odersky <odersky@gmail.com>2003-08-21 10:41:22 +0000
commitd1d13f56f1989f367878553ab2853c5183f5360d (patch)
tree7425807a44773b7630491f42b1dcefd295f9ac7a /sources
parentb227b272110f0654064632642c2ca1031e7c68c6 (diff)
downloadscala-d1d13f56f1989f367878553ab2853c5183f5360d.tar.gz
scala-d1d13f56f1989f367878553ab2853c5183f5360d.tar.bz2
scala-d1d13f56f1989f367878553ab2853c5183f5360d.zip
*** empty log message ***
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/Symbol.java14
-rw-r--r--sources/scalac/symtab/SymbolTablePrinter.java2
2 files changed, 12 insertions, 4 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 05777015ba..99731aa056 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -434,16 +434,24 @@ public abstract class Symbol implements Modifiers, Kinds {
/** Get the fully qualified name of this Symbol
* (this is always a normal name, never a type name)
*/
+
+ /** Get the simple name of this Symbol (this is always a term name)
+ */
+ public Name simpleName() {
+ return isConstructor() ? constructorClass().name.toTermName()
+ : name.toTermName();
+ }
+
/** Get the fully qualified name of this Symbol */
public Name fullName() {
- return name.toTermName();
+ return simpleName();
}
/** Get the mangled name of this Symbol
* (this is always a normal name, never a type name)
*/
public Name mangledName() {
- return name.toTermName();
+ return isConstructor() ? constructorClass().name.toTermName() : name.toTermName();
}
/** Get the fully qualified mangled name of this Symbol */
@@ -860,7 +868,7 @@ public abstract class Symbol implements Modifiers, Kinds {
* $eq => =.
*/
public String nameString() {
- return NameTransformer.decode(name).toString();
+ return NameTransformer.decode(simpleName()).toString();
}
/** String representation of symbol's full name.
diff --git a/sources/scalac/symtab/SymbolTablePrinter.java b/sources/scalac/symtab/SymbolTablePrinter.java
index 6a3dd3e7b4..fdc40da179 100644
--- a/sources/scalac/symtab/SymbolTablePrinter.java
+++ b/sources/scalac/symtab/SymbolTablePrinter.java
@@ -297,7 +297,7 @@ public class SymbolTablePrinter {
/** Returns the name of the given symbol. */
public String getSymbolName(Symbol symbol) {
- Name name = symbol.name;
+ Name name = symbol.simpleName();
if (!global.debug) name = NameTransformer.decode(name);
return name.toString();
}