From bbe5f17384e8e1ed5492516ca0d9e397cd770823 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 13 Jan 2014 17:17:01 +0100 Subject: Fix to typedFunction We now assume protoFormals and protoResultType as given in an expected function type, and check post-hoc that parameter lists have the right length. --- src/dotty/tools/dotc/typer/Typer.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 092c78d4f..18f6fa89a 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -520,8 +520,8 @@ class Typer extends Namer with Applications with Implicits { else { val params = args.asInstanceOf[List[untpd.ValDef]] val (protoFormals, protoResult): (List[Type], Type) = pt match { - case _ if pt isRef defn.FunctionClass(params.length) => - (pt.typeArgs take params.length, pt.typeArgs.last) + case _ if defn.isFunctionType(pt) => + (pt.dealias.typeArgs.init, pt.dealias.typeArgs.last) case SAMType(meth) => val mt @ MethodType(_, paramTypes) = meth.info (paramTypes, mt.resultType) -- cgit v1.2.3