summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2009-11-12 21:04:25 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2009-11-12 21:04:25 +0000
commitd24de699d877477a1c321b81ff9740b753fda659 (patch)
tree00b94e2dd23f629fb692e67637a59857aec71776
parent8f53cc93ec8f3383fdcd185f8087939fca46123c (diff)
downloadscala-d24de699d877477a1c321b81ff9740b753fda659.tar.gz
scala-d24de699d877477a1c321b81ff9740b753fda659.tar.bz2
scala-d24de699d877477a1c321b81ff9740b753fda659.zip
documentation for fix of #2482
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
index 2d1855dc84..84b08f1258 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
@@ -67,6 +67,7 @@ abstract class Pickler extends SubComponent {
private var ep = 0
private val index = new LinkedHashMap[AnyRef, Int]
+ // collect higher-order type params
private var locals: Set[Symbol] = Set()
// private var boundSyms: List[Symbol] = Nil
@@ -80,16 +81,16 @@ abstract class Pickler extends SubComponent {
else sym.owner
/** Is root in symbol.owner*, or should it be treated as a local symbol
- * anyway? This is the case if symbol is a refinement class or
- * an existentially bound variable.
+ * anyway? This is the case if symbol is a refinement class,
+ * an existentially bound variable, or a higher-order type parameter.
*/
private def isLocal(sym: Symbol): Boolean =
!sym.isPackageClass &&
(sym.name.toTermName == rootName && sym.owner == rootOwner ||
sym != NoSymbol && isLocal(sym.owner) ||
sym.isRefinementClass ||
- sym.isAbstractType && sym.hasFlag(EXISTENTIAL) ||
- (locals contains sym))
+ sym.isAbstractType && sym.hasFlag(EXISTENTIAL) || // existential param
+ (locals contains sym)) // higher-order type param
private def staticAnnotations(annots: List[AnnotationInfo]) =
annots filter(ann =>
@@ -191,11 +192,11 @@ abstract class Pickler extends SubComponent {
putType(restpe); putSymbols(params)
case PolyType(tparams, restpe) =>
tparams foreach { tparam =>
- if (!isLocal(tparam)) locals += tparam
+ if (!isLocal(tparam)) locals += tparam // similar to existential types, these tparams are local
}
putType(restpe); putSymbols(tparams)
case ExistentialType(tparams, restpe) =>
-// val savedBoundSyms = boundSyms
+// val savedBoundSyms = boundSyms // boundSyms are known to be local based on the EXISTENTIAL flag (see isLocal)
// boundSyms = tparams ::: boundSyms
// try {
putType(restpe);