summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
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();
}