summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-11-19 16:22:20 +0000
committerMartin Odersky <odersky@gmail.com>2007-11-19 16:22:20 +0000
commit1c3653233e48b93a32efacf00517a6738e0969bc (patch)
treeb09c44a8845250611a7da0b01deff072c7147df6 /src
parent44b2aab80481f9884dcbd61ae88c189967401ff5 (diff)
downloadscala-1c3653233e48b93a32efacf00517a6738e0969bc.tar.gz
scala-1c3653233e48b93a32efacf00517a6738e0969bc.tar.bz2
scala-1c3653233e48b93a32efacf00517a6738e0969bc.zip
fixed #226 and #227
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala10
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 25c34bcce8..0754313be3 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1320,9 +1320,13 @@ trait Types {
sym.isModuleClass || sym == AllClass || isValueClass(sym) || super.isNotNull
// @M: propagate actual type params (args) to `tp', by replacing formal type parameters with actual ones
- def transform(tp: Type): Type =
- tp.asSeenFrom(pre, sym.owner).instantiateTypeParams(sym.typeParams, argsMaybeDummy)
+ def transform(tp: Type): Type = {
+ val args = argsMaybeDummy
+ if (args.length == sym.typeParams.length)
+ tp.asSeenFrom(pre, sym.owner).instantiateTypeParams(sym.typeParams, argsMaybeDummy)
+ else { assert(args exists (_.isError)); tp }
// @M TODO maybe we shouldn't instantiate type params if isHigherKinded -- probably needed for partial type application though
+ }
//@M! use appliedType on the polytype that represents the bounds (or if aliastype, the rhs)
def transformInfo(tp: Type): Type =
@@ -3552,7 +3556,7 @@ A type's typeSymbol should never be inspected directly.
else {
def lubBounds(bnds: List[TypeBounds]): TypeBounds =
mkTypeBounds(glb(bnds map (_.lo), depth-1), lub(bnds map (_.hi), depth-1))
- recycle(proto.owner.newAbstractType(proto.pos, proto.name))
+ recycle(lubRefined.typeSymbol.newAbstractType(proto.pos, proto.name))
.setInfo(lubBounds(symtypes map (_.bounds)))
}
}
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
index 53d02d4569..4c61981c9d 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
@@ -162,7 +162,8 @@ abstract class Pickler extends SubComponent {
putType(lo); putType(hi)
case RefinedType(parents, decls) =>
val rclazz = tp.typeSymbol
- assert(decls.elements forall (_.owner == rclazz))
+ for (m <- decls.elements)
+ if (m.owner != rclazz) assert(false, "bad refinement member "+m+" of "+tp+", owner = "+m.owner)
putSymbol(rclazz); putTypes(parents); putSymbols(decls.toList)
case ClassInfoType(parents, decls, clazz) =>
putSymbol(clazz); putTypes(parents); putSymbols(decls.toList)