aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-07 17:56:05 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-07 17:56:05 +0200
commit306d422f1e3017731d1f9266f9d445e77ea73105 (patch)
treed3ba668ce0baec84f3694b35e53efb0041171c45 /src/dotty/tools/dotc/typer/Typer.scala
parent422b06126d3809f4db11dba0988cd21857e1f9de (diff)
downloaddotty-306d422f1e3017731d1f9266f9d445e77ea73105.tar.gz
dotty-306d422f1e3017731d1f9266f9d445e77ea73105.tar.bz2
dotty-306d422f1e3017731d1f9266f9d445e77ea73105.zip
Take type parameters for this(...) constructor calls from prefix
Previously, those were inferred from arguments, but this is wrong because we implicitly assume that the type parameters of the constructor and the type parameters of the class are the same. I could not find a test that fails for this. But if you look at the -Xprint:front output of pos/i941.scala, you notice that the inferred argument to the this(...) call was `Nothing` where it should have been `A`.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index fac24e440..3d36905f2 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1677,7 +1677,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
if (pt.isInstanceOf[PolyProto]) tree
else {
var typeArgs = tree match {
- case Select(New(tpt), nme.CONSTRUCTOR) => tpt.tpe.dealias.argTypesLo
+ case Select(qual, nme.CONSTRUCTOR) => qual.tpe.widenDealias.argTypesLo
case _ => Nil
}
if (typeArgs.isEmpty) typeArgs = constrained(poly, tree)._2