From 0c582b883971fd89476244aa6905be95da7e79d0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 27 Sep 2013 22:10:45 +0200 Subject: Several bug fixes to typer and classfile reader. In particular, changed internal representation of Java constructors and changed treatment of parent constructors in templates. --- src/dotty/tools/dotc/typer/Namer.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index a803903bb..e9eb7df0b 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -13,6 +13,7 @@ import util.SourcePosition import collection.mutable import annotation.tailrec import ErrorReporting._ +import tpd.ListOfTreeDecorator import language.implicitConversions trait NamerContextOps { this: Context => @@ -296,8 +297,13 @@ class Namer { typer: Typer => def classDefSig(cdef: TypeDef, cls: ClassSymbol)(implicit ctx: Context): Type = { //todo: normalize parents, so that all mixins extend superclass def parentType(constr: untpd.Tree): Type = { - val Trees.Select(Trees.New(tpt), _) = methPart(constr) - val ptype = typedAheadType(tpt).tpe + val (core, targs) = stripApply(constr) match { + case TypeApply(core, targs) => (core, targs) + case core => (core, Nil) + } + val Select(New(tpt), _) = core + val targs1 = targs map (typedAheadType(_)) + val ptype = typedAheadType(tpt).tpe appliedTo targs1.tpes if (ptype.uninstantiatedTypeParams.isEmpty) ptype else typedAheadExpr(constr).tpe } -- cgit v1.2.3