diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2009-11-13 12:17:50 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2009-11-13 12:17:50 +0000 |
commit | 261a8076558d98dbf1311ec6b1db6dbb10f8e9c9 (patch) | |
tree | e01c066f1e436eaae94e4ed72775c1af243332dd /src/compiler | |
parent | d47dbcf17b45bb9efc28c2171a06a9c835595122 (diff) | |
download | scala-261a8076558d98dbf1311ec6b1db6dbb10f8e9c9.tar.gz scala-261a8076558d98dbf1311ec6b1db6dbb10f8e9c9.tar.bz2 scala-261a8076558d98dbf1311ec6b1db6dbb10f8e9c9.zip |
fixed #1236
another Symbol::tpe bites the dust (should'be been tpeHK)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 21 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 6145c4a0d7..35afe7cf5f 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1988,16 +1988,17 @@ A type's typeSymbol should never be inspected directly. case class AntiPolyType(pre: Type, targs: List[Type]) extends Type { override def safeToString = pre.toString + targs.mkString("(with type arguments ", ",", ")"); - override def memberType(sym: Symbol) = pre.memberType(sym) match { - case PolyType(tparams, restp) => - restp.subst(tparams, targs) -/* I don't think this is needed, as existential types close only over value types - case ExistentialType(tparams, qtpe) => - existentialAbstraction(tparams, qtpe.memberType(sym)) -*/ - case ErrorType => - ErrorType - } + override def memberType(sym: Symbol) = appliedType(pre.memberType(sym), targs) +// override def memberType(sym: Symbol) = pre.memberType(sym) match { +// case PolyType(tparams, restp) => +// restp.subst(tparams, targs) +// /* I don't think this is needed, as existential types close only over value types +// case ExistentialType(tparams, qtpe) => +// existentialAbstraction(tparams, qtpe.memberType(sym)) +// */ +// case ErrorType => +// ErrorType +// } override def kind = "AntiPolyType" } diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 0c3e34f8c5..69407ef0f1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1736,7 +1736,7 @@ trait Infer { if (sym.hasFlag(OVERLOADED)) { val tparams = new AsSeenFromMap(pre, sym.alternatives.head.owner).mapOver( sym.alternatives.head.typeParams) - val bounds = tparams map (_.tpe) //@M TODO: might be affected by change to tpe in Symbol + val bounds = tparams map (_.tpeHK) // see e.g., #1236 val tpe = PolyType(tparams, OverloadedType(AntiPolyType(pre, bounds), sym.alternatives)) |