diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-26 23:53:26 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-26 23:53:26 +0000 |
commit | 72d12aabf35f699ef103d79f29f8f7b21286d94c (patch) | |
tree | d2010d12e1dcc9705a9c7ff3b1005e728c04cc16 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 5be89bb3bf95f9a11773273fee5d692e4a9a7f03 (diff) | |
download | scala-72d12aabf35f699ef103d79f29f8f7b21286d94c.tar.gz scala-72d12aabf35f699ef103d79f29f8f7b21286d94c.tar.bz2 scala-72d12aabf35f699ef103d79f29f8f7b21286d94c.zip |
Some work on error messages, somewhat based on ...
Some work on error messages, somewhat based on ideas in #3092. No
review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 0ead1f6eee..155883299a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2036,11 +2036,7 @@ trait Typers { self: Analyzer => } case _ => } - error( - vparam.pos, - "missing parameter type"+ - (if (vparam.mods.isSynthetic) " for expanded function "+fun - else "")) + error(vparam.pos, missingParameterTypeMsg(fun, vparam)) ErrorType } if (!vparam.tpt.pos.isDefined) vparam.tpt setPos vparam.pos.focus @@ -2390,16 +2386,7 @@ trait Typers { self: Analyzer => if (!(context.diagnostic contains note)) context.diagnostic = note :: context.diagnostic doTypedApply(tree, if (blockIsEmpty) fun else fun1, allArgs, mode, pt) } else { - tryTupleApply.getOrElse { - val suffix = - if (missing.isEmpty) "" - else { - val missingStr = missing.take(3).map(_.name).mkString(", ") + (if (missing.length > 3) ", ..." else ".") - val sOpt = if (missing.length > 1) "s" else "" - ".\nUnspecified value parameter"+ sOpt +" "+ missingStr - } - errorTree(tree, "not enough arguments for "+treeSymTypeMsg(fun) + suffix) - } + tryTupleApply getOrElse errorTree(tree, notEnoughArgumentsMsg(fun, missing)) } } } |