aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-12-17 23:28:27 +0100
committerMartin Odersky <odersky@gmail.com>2013-12-17 23:28:27 +0100
commit6b106397a683b9de4bf05da7e768ebf747085c55 (patch)
treefbbca5080536d195034eed0d8a0a8c77e48a0624 /src/dotty/tools/dotc/typer/Namer.scala
parent9e8d0709e9f43fbb1dc40baaab4f0891538d8e9c (diff)
downloaddotty-6b106397a683b9de4bf05da7e768ebf747085c55.tar.gz
dotty-6b106397a683b9de4bf05da7e768ebf747085c55.tar.bz2
dotty-6b106397a683b9de4bf05da7e768ebf747085c55.zip
Fixes to parent types.
The previous addition of checkClassTypeWithStablePrefix to Namer#classSig needs to be adjusted.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 9d0ec539c..1908cbafd 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -348,9 +348,9 @@ class Namer { typer: Typer =>
}
val Select(New(tpt), nme.CONSTRUCTOR) = core
val targs1 = targs map (typedAheadType(_))
- var ptype = typedAheadType(tpt).tpe appliedTo targs1.tpes
- if (ptype.uninstantiatedTypeParams.nonEmpty) ptype = typedAheadExpr(constr).tpe
- checkClassTypeWithStablePrefix(ptype, core.pos)
+ val ptype = typedAheadType(tpt).tpe appliedTo targs1.tpes
+ if (ptype.uninstantiatedTypeParams.isEmpty) ptype
+ else typedAheadExpr(constr).tpe
}
val TypeDef(_, name, impl @ Template(constr, parents, self, body)) = cdef
@@ -366,9 +366,13 @@ class Namer { typer: Typer =>
cls.info = adjustIfModule(ClassInfo(cls.owner.thisType, cls, Nil, decls, selfInfo))
val parentTypes = parents map parentType
val parentRefs = ctx.normalizeToRefs(parentTypes, cls, decls)
+ val parentClsRefs =
+ for ((parentRef, constr) <- parentRefs zip parents)
+ yield checkClassTypeWithStablePrefix(parentRef, constr.pos)
+
index(constr)
index(rest)(inClassContext(selfInfo))
- ClassInfo(cls.owner.thisType, cls, parentRefs, decls, selfInfo)
+ ClassInfo(cls.owner.thisType, cls, parentClsRefs, decls, selfInfo)
}
def adjustIfModule(sig: Type): Type =