summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-04 18:05:39 +0000
committerPaul Phillips <paulp@improving.org>2010-03-04 18:05:39 +0000
commitf9c2792695a80e6a20414bc2008bc33bcb9d8cc9 (patch)
treee7859b6ff04b9e9a2fd5b14e0c2271a651fec1af
parent5679285ec4db259d9618caef74918ea554a5e19e (diff)
downloadscala-f9c2792695a80e6a20414bc2008bc33bcb9d8cc9.tar.gz
scala-f9c2792695a80e6a20414bc2008bc33bcb9d8cc9.tar.bz2
scala-f9c2792695a80e6a20414bc2008bc33bcb9d8cc9.zip
Added a comment to Symbols after one too many t...
Added a comment to Symbols after one too many times forgetting what I was in that file for while I traced which of the linked* functions I wanted. Review by odersky (only because there's also a renaming proposal in there for which I solicit your yea or nay.)
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 328b9c2311..f7075a4f72 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -1207,6 +1207,37 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
res
}
+ /** @PP: Added diagram because every time I come through here I end up
+ * losing my train of thought. Any errors are mine.
+ *
+ * class Foo <
+ * ^ ^ (2) \
+ * | | | \
+ * | (5) | (3)
+ * | | | \
+ * (1) v v \
+ * object Foo (4)-> > class Foo$
+ *
+ * (1) linkedClassOfModule
+ * (2) linkedModuleOfClass
+ * (3) linkedClassOfClass
+ * (4) moduleClass
+ * (5) linkedSym
+ */
+
+ /** I propose to rename these, as I at least would find it
+ * a lot less confusing to call them:
+ *
+ * def companionModule
+ * def companionClass
+ * def companionModuleClass
+ * def companionSymbol (bidirectional between companionModule + companionClass)
+ * def linkedClassOfClass (bidirectional between companionClass + companionModuleClass)
+ *
+ * linkedClassOfClass ceases to be confusing after in the context of
+ * the first four names.
+ */
+
/** The class with the same name in the same package as this module or
* case class factory. A better name would be companionClassOfModule.
*/
@@ -1247,7 +1278,7 @@ trait Symbols extends reflect.generic.Symbols { self: SymbolTable =>
* class Foo
*
* Then object Foo has a `moduleClass' (invisible to the user, the backend calls it Foo$
- * linkedClassOFClass goes from class Foo$ to class Foo, and back.
+ * linkedClassOfClass goes from class Foo$ to class Foo, and back.
*/
final def linkedClassOfClass: Symbol =
if (isModuleClass) linkedClassOfModule else linkedModuleOfClass.moduleClass