diff options
author | Paul Phillips <paulp@improving.org> | 2011-07-23 20:50:24 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-07-23 20:50:24 +0000 |
commit | 5c61410fe5b8fd636bde6484f04a2d1160ed7eb4 (patch) | |
tree | 7d6d8068b148e0282bc5156d3e8fde1f9ac4fb7f /src/compiler/scala/reflect/internal/Symbols.scala | |
parent | f9f164d3c71aee897e7885e4c991866bd1c0c339 (diff) | |
download | scala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.tar.gz scala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.tar.bz2 scala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.zip |
Start of an attempt to abstract above some hard...
Start of an attempt to abstract above some hardcoded name mangling
decisions so they can be modified, something we need to do to fix
long-standing problems with inner classes. It's not easy. This commit
doesn't actually change much, it's primarily setup. No review.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Symbols.scala')
-rw-r--r-- | src/compiler/scala/reflect/internal/Symbols.scala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala index f9afd164f5..91f052af6c 100644 --- a/src/compiler/scala/reflect/internal/Symbols.scala +++ b/src/compiler/scala/reflect/internal/Symbols.scala @@ -620,6 +620,8 @@ trait Symbols extends api.Symbols { self: SymbolTable => } def ownerChain: List[Symbol] = this :: owner.ownerChain + def originalOwnerChain: List[Symbol] = this :: originalOwner.getOrElse(this, rawowner).originalOwnerChain + def enclClassChain: List[Symbol] = { if (this eq NoSymbol) Nil else if (isClass && !isPackageClass) this :: owner.enclClassChain @@ -665,7 +667,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => */ def originalName = nme.originalName(name) - /** The name of the symbol before decoding, e.g. `\$eq\$eq` instead of `==`. + /** The name of the symbol before decoding, e.g. `\$eq\$eq` instead of `==`. */ def encodedName: String = name.toString @@ -673,6 +675,17 @@ trait Symbols extends api.Symbols { self: SymbolTable => */ def decodedName: String = stripLocalSuffix(NameTransformer.decode(encodedName)) + def moduleSuffix: String = ( + if (hasModuleFlag && !isMethod && !isImplClass && !isJavaDefined) nme.MODULE_SUFFIX_STRING + else "" + ) + + /** These should be moved somewhere like JavaPlatform. + */ + def javaSimpleName = stripLocalSuffix("" + simpleName) + moduleSuffix + def javaBinaryName = fullName('/') + moduleSuffix + def javaClassName = fullName('.') + moduleSuffix + /** The encoded full path name of this symbol, where outer names and inner names * are separated by `separator` characters. * Never translates expansions of operators back to operator symbol. |