From 6cca64fa0aa37942812d1c870b99f309dab67352 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 7 Oct 2015 12:42:38 +0200 Subject: Check that some types are not higher-kinded. Invalidates #813. Review by @darkdimius. --- src/dotty/tools/dotc/typer/Typer.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index b28ac9bc5..d94505e29 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -369,7 +369,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (untpd.isWildcardStarArg(tree)) TypeTree(defn.SeqClass.typeRef.appliedTo(pt :: Nil)) else - typedType(tree.tpt) + checkSimpleKinded(typedType(tree.tpt)) val expr1 = if (isWildcard) tree.expr withType tpt1.tpe else typed(tree.expr, tpt1.tpe) @@ -917,7 +917,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedValDef(vdef: untpd.ValDef, sym: Symbol)(implicit ctx: Context) = track("typedValDef") { val ValDef(name, tpt, _) = vdef completeAnnotations(vdef, sym) - val tpt1 = typedType(tpt) + val tpt1 = checkSimpleKinded(typedType(tpt)) val rhs1 = vdef.rhs match { case rhs @ Ident(nme.WILDCARD) => rhs withType tpt1.tpe case rhs => typedExpr(rhs, tpt1.tpe) @@ -931,7 +931,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val tparams1 = tparams mapconserve (typed(_).asInstanceOf[TypeDef]) val vparamss1 = vparamss nestedMapconserve (typed(_).asInstanceOf[ValDef]) if (sym is Implicit) checkImplicitParamsNotSingletons(vparamss1) - val tpt1 = typedType(tpt) + val tpt1 = checkSimpleKinded(typedType(tpt)) val rhs1 = typedExpr(ddef.rhs, tpt1.tpe) assignType(cpy.DefDef(ddef)(name, tparams1, vparamss1, tpt1, rhs1), sym) //todo: make sure dependent method types do not depend on implicits or by-name params -- cgit v1.2.3