From d778feed547bda33cf823e85a2e0696496df744e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 13 Jan 2014 14:40:52 +0100 Subject: When typing a function value (xs) => T with a function type as exp[ected type, check that argument lists have same length. --- src/dotty/tools/dotc/typer/Typer.scala | 3 +++ 1 file changed, 3 insertions(+) (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 817053868..092c78d4f 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -586,6 +586,9 @@ class Typer extends Namer with Applications with Implicits { errorType(s"missing parameter type for parameter ${param.name}$ofFun, expected = ${pt.show}", param.pos) } + if (protoFormals.length != params.length) + ctx.error(s"wrong number of parameters, expected: ${protoFormals.length}", tree.pos) + val inferredParams: List[untpd.ValDef] = for ((param, formal) <- params zip protoFormals) yield if (!param.tpt.isEmpty) param -- cgit v1.2.3