diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-13 14:54:27 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-17 18:34:27 +0100 |
commit | cc4c3acf7d0aa9a2e612e228c17dc3f3294f0126 (patch) | |
tree | 8b4b0b2bc3621c96a5e48f1756af3c515ceb8e45 /compiler/src/dotty/tools/dotc/reporting/diagnostic | |
parent | c9f666f7c21df45bf085ff2d6f6b0fbd7d01c72d (diff) | |
download | dotty-cc4c3acf7d0aa9a2e612e228c17dc3f3294f0126.tar.gz dotty-cc4c3acf7d0aa9a2e612e228c17dc3f3294f0126.tar.bz2 dotty-cc4c3acf7d0aa9a2e612e228c17dc3f3294f0126.zip |
Fix "wrong number of args" reporting
"Wrong number of args" only works for type arguments but was called also for
term arguments. Ideally we should have a WrongNumberOfArgs message that works for
both, but this will take some refactoring.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting/diagnostic')
-rw-r--r-- | compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index 489165e56..9dda233bf 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -224,6 +224,8 @@ object messages { extends Message(8) { val kind = "Member Not Found" + //println(i"site = $site, decls = ${site.decls}, source = ${site.widen.typeSymbol.sourceFile}") //DEBUG + val msg = { import core.Flags._ val maxDist = 3 @@ -606,7 +608,7 @@ object messages { |""" } - case class WrongNumberOfArgs(fntpe: Type, argKind: String, expectedArgs: List[TypeParamInfo], actual: List[untpd.Tree])(implicit ctx: Context) + case class WrongNumberOfTypeArgs(fntpe: Type, expectedArgs: List[TypeParamInfo], actual: List[untpd.Tree])(implicit ctx: Context) extends Message(22) { val kind = "Syntax" @@ -628,7 +630,7 @@ object messages { } val msg = - hl"""|${NoColor(msgPrefix)} ${argKind} arguments for $prettyName$expectedArgString + hl"""|${NoColor(msgPrefix)} type arguments for $prettyName$expectedArgString |expected: $expectedArgString |actual: $actualArgString""".stripMargin |