aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-12-04 17:55:21 +0100
committerMartin Odersky <odersky@gmail.com>2015-12-06 16:17:43 +0100
commitf8d82c2634dcf9d94037b107d49d088e89f7070f (patch)
treed32f3c0e241b8cb4bcf75ce3ff233271925e31b4 /src/dotty/tools/dotc/typer
parentdec21f5ea39a2c2c059c829ac16edd68f71793ee (diff)
downloaddotty-f8d82c2634dcf9d94037b107d49d088e89f7070f.tar.gz
dotty-f8d82c2634dcf9d94037b107d49d088e89f7070f.tar.bz2
dotty-f8d82c2634dcf9d94037b107d49d088e89f7070f.zip
Switch to new hk scheme.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala4
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala7
2 files changed, 5 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index e8ba3b07b..d119658be 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -614,10 +614,10 @@ trait Applications extends Compatibility { self: Typer =>
}
def adaptTypeArg(tree: tpd.Tree, bound: Type)(implicit ctx: Context): tpd.Tree = {
- val was = tree.tpe.EtaExpandIfHK(bound)
+ //val was = tree.tpe.EtaExpandIfHK(bound)
//val now = tree.tpe.adaptIfHK(bound) // ###
//if (was != now) println(i"diff adapt ${tree.tpe} to $bound, was: $was, now: $now")
- tree.withType(was)//tree.tpe.adaptIfHK(bound))
+ tree.withType(tree.tpe.adaptIfHK(bound))
}
/** Rewrite `new Array[T](....)` trees to calls of newXYZArray methods. */
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 3f5c4f47e..f857a2504 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -348,10 +348,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
typed(cpy.Block(tree)(clsDef :: Nil, New(Ident(x), Nil)), pt)
case _ =>
var tpt1 = typedType(tree.tpt)
- if (tpt1.tpe.isHK) {
- val deAliased = tpt1.tpe.dealias.EtaReduce
- if (deAliased.exists && deAliased.ne(tpt1.tpe))
- tpt1 = tpt1.withType(deAliased)
+ tpt1.tpe.dealias match {
+ case TypeApplications.EtaExpansion(tycon) => tpt1 = tpt1.withType(tycon)
+ case _ =>
}
checkClassTypeWithStablePrefix(tpt1.tpe, tpt1.pos, traitReq = false)
assignType(cpy.New(tree)(tpt1), tpt1)