diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-13 14:40:52 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-13 14:40:52 +0100 |
commit | d778feed547bda33cf823e85a2e0696496df744e (patch) | |
tree | 703f140e004f7dc882a1bb5d3f1468e8285f22c8 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 620359dc261c12456519c142e3a6e9842f750989 (diff) | |
download | dotty-d778feed547bda33cf823e85a2e0696496df744e.tar.gz dotty-d778feed547bda33cf823e85a2e0696496df744e.tar.bz2 dotty-d778feed547bda33cf823e85a2e0696496df744e.zip |
When typing a function value (xs) => T with a function type as exp[ected type,
check that argument lists have same length.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 3 |
1 files changed, 3 insertions, 0 deletions
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 |