aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-07-14 18:06:48 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-14 19:52:22 +0200
commit82fc27f0c2c800de786b54110cfd8627b043fe6d (patch)
tree92bff1bc2f6869495e46fd77a1220153c25b46ac /src/dotty/tools/dotc/core/TypeApplications.scala
parent18b30803952cee83580eab28068bc773fdce780e (diff)
downloaddotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.tar.gz
dotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.tar.bz2
dotty-82fc27f0c2c800de786b54110cfd8627b043fe6d.zip
Fix bounds checking of hk applied typed
Previous logic could only handle classes as constructors. Also, address other reviewers comments.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index ef241cb66..314233709 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -338,13 +338,12 @@ class TypeApplications(val self: Type) extends AnyVal {
*
* TODO: Handle parameterized lower bounds
*/
- def LambdaAbstract(tparams: List[Symbol])(implicit ctx: Context): Type = {
+ def LambdaAbstract(tparams: List[TypeParamInfo])(implicit ctx: Context): Type = {
def expand(tp: Type) =
TypeLambda(
- tpnme.syntheticLambdaParamNames(tparams.length), tparams.map(_.variance))(
+ tpnme.syntheticLambdaParamNames(tparams.length), tparams.map(_.paramVariance))(
tl => tparams.map(tparam => tl.lifted(tparams, tparam.paramBounds).bounds),
tl => tl.lifted(tparams, tp))
- assert(!isHK, self)
self match {
case self: TypeAlias =>
self.derivedTypeAlias(expand(self.alias))
@@ -489,6 +488,8 @@ class TypeApplications(val self: Type) extends AnyVal {
}
else dealiased.resType match {
case AppliedType(tycon, args1) if tycon.safeDealias ne tycon =>
+ // In this case we should always dealias since we cannot handle
+ // higher-kinded applications to wildcard arguments.
dealiased
.derivedTypeLambda(resType = tycon.safeDealias.appliedTo(args1))
.appliedTo(args)