From 35d0acdad24717c1843304fd5eb124313658e7d2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 11 Apr 2017 17:07:08 +0200 Subject: 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. --- compiler/src/dotty/tools/dotc/typer/Namer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler') 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: -- cgit v1.2.3