aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-11 17:07:08 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 17:07:46 +0200
commit35d0acdad24717c1843304fd5eb124313658e7d2 (patch)
tree6f9caaf450959f58a1c77c1829a6a63b18add7e4 /compiler
parent9917029becab32d56e786ac9309ee195737f6da0 (diff)
downloaddotty-35d0acdad24717c1843304fd5eb124313658e7d2.tar.gz
dotty-35d0acdad24717c1843304fd5eb124313658e7d2.tar.bz2
dotty-35d0acdad24717c1843304fd5eb124313658e7d2.zip
Add fullyDefinedType for class parent types
If we do not do that, any type variables in the parent type get interpolated later, when the whole primary constructor is typed. But by then we miss the context of what their variance was.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Namer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala
index 19b6dfa71..da9f9f6ac 100644
--- a/compiler/src/dotty/tools/dotc/typer/Namer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala
@@ -843,7 +843,7 @@ class Namer { typer: Typer =>
val targs1 = targs map (typedAheadType(_))
val ptype = typedAheadType(tpt).tpe appliedTo targs1.tpes
if (ptype.typeParams.isEmpty) ptype
- else typedAheadExpr(parent).tpe
+ else fullyDefinedType(typedAheadExpr(parent).tpe, "class parent", parent.pos)
}
/* Check parent type tree `parent` for the following well-formedness conditions: