aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-27 22:10:45 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-28 11:43:43 +0200
commit0c582b883971fd89476244aa6905be95da7e79d0 (patch)
tree079efc09d1e5b53b1e258b565dbb15c8b14954f7 /src/dotty/tools/dotc/typer/Namer.scala
parentfcb68309c2760a6797b0a9ec23722808060e9aa1 (diff)
downloaddotty-0c582b883971fd89476244aa6905be95da7e79d0.tar.gz
dotty-0c582b883971fd89476244aa6905be95da7e79d0.tar.bz2
dotty-0c582b883971fd89476244aa6905be95da7e79d0.zip
Several bug fixes to typer and classfile reader.
In particular, changed internal representation of Java constructors and changed treatment of parent constructors in templates.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala10
1 files changed, 8 insertions, 2 deletions
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
}