aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2016-12-18 16:05:15 +0100
committerGitHub <noreply@github.com>2016-12-18 16:05:15 +0100
commit7866bc2620098a7a692b68ac9c37e6d8a05ec774 (patch)
treefa37e7fe072bfa501666823e2f8c1da7f0f13994 /compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
parent18b8daa30916b2efaa59638c21198d401a67e46a (diff)
parent2e99511840915e2805e7a2c07571d3859a3db698 (diff)
downloaddotty-7866bc2620098a7a692b68ac9c37e6d8a05ec774.tar.gz
dotty-7866bc2620098a7a692b68ac9c37e6d8a05ec774.tar.bz2
dotty-7866bc2620098a7a692b68ac9c37e6d8a05ec774.zip
Merge pull request #1775 from dotty-staging/add-implicit-funtypes
Add implicit function types
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
index ca0af0e2b..4a97648f5 100644
--- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
+++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -313,7 +313,8 @@ trait TypeAssigner {
val ownType = fn.tpe.widen match {
case fntpe @ MethodType(_, ptypes) =>
if (sameLength(ptypes, args) || ctx.phase.prev.relaxedTyping) fntpe.instantiate(args.tpes)
- else wrongNumberOfArgs(fn.tpe, "", fntpe.typeParams, args, tree.pos)
+ else
+ errorType(i"wrong number of arguments for $fntpe: ${fn.tpe}, expected: ${ptypes.length}, found: ${args.length}", tree.pos)
case t =>
errorType(i"${err.exprStr(fn)} does not take parameters", tree.pos)
}
@@ -368,7 +369,7 @@ trait TypeAssigner {
else {
val argTypes = args.tpes
if (sameLength(argTypes, paramNames) || ctx.phase.prev.relaxedTyping) pt.instantiate(argTypes)
- else wrongNumberOfArgs(fn.tpe, "type", pt.typeParams, args, tree.pos)
+ else wrongNumberOfTypeArgs(fn.tpe, pt.typeParams, args, tree.pos)
}
case _ =>
errorType(i"${err.exprStr(fn)} does not take type parameters", tree.pos)
@@ -461,7 +462,7 @@ trait TypeAssigner {
val ownType =
if (hasNamedArg(args)) (tycon.tpe /: args)(refineNamed)
else if (sameLength(tparams, args)) tycon.tpe.appliedTo(args.tpes)
- else wrongNumberOfArgs(tycon.tpe, "type", tparams, args, tree.pos)
+ else wrongNumberOfTypeArgs(tycon.tpe, tparams, args, tree.pos)
tree.withType(ownType)
}