aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-07-20 13:59:34 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-18 18:12:16 +0200
commit38ac02916ec0beef0cb93f0fdd48ad1f9dfdcf48 (patch)
treeed5255fab168a5d0eecac8e052ce843b43dc3536 /src/dotty/tools/dotc/typer
parent5a9a48d21038b78545aba15d0d99238c3c395d47 (diff)
downloaddotty-38ac02916ec0beef0cb93f0fdd48ad1f9dfdcf48.tar.gz
dotty-38ac02916ec0beef0cb93f0fdd48ad1f9dfdcf48.tar.bz2
dotty-38ac02916ec0beef0cb93f0fdd48ad1f9dfdcf48.zip
Replace isLambda with ifHK
Replace occurrences of isLambda with isHK, because isHK is a bit faster and simplier.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala7
3 files changed, 3 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 8800c1a55..c7d8acb37 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -613,7 +613,7 @@ trait Applications extends Compatibility { self: Typer =>
}
def adaptTypeArg(tree: tpd.Tree, bound: Type)(implicit ctx: Context): tpd.Tree =
- tree.withType(tree.tpe.EtaExpandIfLambda(bound))
+ tree.withType(tree.tpe.EtaExpandIfHK(bound))
/** Rewrite `new Array[T](....)` trees to calls of newXYZArray methods. */
def convertNewArray(tree: tpd.Tree)(implicit ctx: Context): tpd.Tree = tree match {
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 225235822..c1341a9ae 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -822,7 +822,7 @@ class Namer { typer: Typer =>
val tycon = tp.withoutArgs(args)
val tparams = tycon.typeParams
if (args.length == tparams.length) { // if lengths differ, problem is caught in typedTypeApply
- val args1 = args.zipWithConserve(tparams)((arg, tparam) => arg.EtaExpandIfLambda(tparam.info))
+ val args1 = args.zipWithConserve(tparams)((arg, tparam) => arg.EtaExpandIfHK(tparam.info))
if (args1 ne args) return this(tycon).appliedTo(args1)
}
}
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 3f7e0b81c..d35356a85 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1434,12 +1434,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case Select(New(tpt), nme.CONSTRUCTOR) => tpt.tpe.dealias.argTypesLo
case _ => Nil
}
- if (typeArgs.isEmpty) {
- //for ((pname, pbound) <- poly.paramNames.zip(poly.paramBounds))
- // if (pbound.hi.isSafeLambda)
- // ctx.error(d"cannot infer argument for higher-kinded type parameter $pname", tree.pos)
- typeArgs = constrained(poly, tree)._2
- }
+ if (typeArgs.isEmpty) typeArgs = constrained(poly, tree)._2
convertNewArray(
adaptInterpolated(tree.appliedToTypes(typeArgs), pt, original))
}