summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-03-08 14:27:48 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-03-08 14:27:48 +0000
commit13f24056a444fd5038cebdb294a0959bfe979492 (patch)
tree9084c7312fbdcf9d1eb075bc5a4bfc9cfd72d14a /src
parentb7c17993c61d453c3069a14d66ada6fb7c3301c4 (diff)
downloadscala-13f24056a444fd5038cebdb294a0959bfe979492.tar.gz
scala-13f24056a444fd5038cebdb294a0959bfe979492.tar.bz2
scala-13f24056a444fd5038cebdb294a0959bfe979492.zip
closes #2994
make normalize slightly more aggressive in loading symbol info, while ) tolerating the righteous cycle (use sym.info.typeParameters instead ) of unsafeParams this is needed to make sure higher-kinded types have ) their type parameters (otherwise we'd get a PolyType with NoSymbol for ) typeParams )
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 1c5fb05a72..8b9ed69f47 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -1840,7 +1840,7 @@ self =>
}
val nameOffset = in.offset
val pname =
- (if (in.token == USCORE) { // @M! also allow underscore
+ (if (in.token == USCORE) { // TODO AM: freshName(o2p(in.skipToken()), "_$$"), will need to update test suite
in.nextToken()
nme.WILDCARD
} else ident()).toTypeName
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 855e6951d0..665239a2a0 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1689,14 +1689,14 @@ A type's typeSymbol should never be inspected directly.
val xform = transform(sym.info.resultType)
assert(xform ne this, this)
xform.normalize // cycles have been checked in typeRef
- } else {
- PolyType(typeParams, transform(sym.info.resultType).normalize) // eta-expand
+ } else { // should rarely happen, if at all
+ PolyType(sym.info.typeParams, transform(sym.info.resultType).normalize) // eta-expand -- for regularity, go through sym.info for typeParams
// @M TODO: should not use PolyType, as that's the type of a polymorphic value -- we really want a type *function*
}
} else if (isHigherKinded) {
// @M TODO: should not use PolyType, as that's the type of a polymorphic value -- we really want a type *function*
- // @M: initialize needed (see test/files/pos/ticket0137.scala)
- PolyType(typeParams, typeRef(pre, sym.initialize, dummyArgs))
+ // @M: initialize (by sym.info call) needed (see test/files/pos/ticket0137.scala)
+ PolyType(sym.info.typeParams, typeRef(pre, sym, dummyArgs)) // must go through sym.info for typeParams
} else if (sym.isRefinementClass) {
sym.info.normalize // @MO to AM: OK?
//@M I think this is okay, but changeset 12414 (which fixed #1241) re-introduced another bug (#2208)
@@ -1918,6 +1918,7 @@ A type's typeSymbol should never be inspected directly.
*/
case class PolyType(override val typeParams: List[Symbol], override val resultType: Type)
extends Type {
+ // assert(!(typeParams contains NoSymbol), this)
override def paramSectionCount: Int = resultType.paramSectionCount
override def paramss: List[List[Symbol]] = resultType.paramss