From 473af4da77526505f0e92dcb0ab1679674ef6f4e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 19 May 2013 12:40:31 -0700 Subject: Remove isPossiblyMissingArgs. It has been hardcoded to return false for a long while anyway. --- src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 61e4f6bb1e..9a18248929 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -96,11 +96,7 @@ trait ContextErrors { def issueTypeError(err: AbsTypeError)(implicit context: Context) { context.issue(err) } - def typeErrorMsg(found: Type, req: Type, possiblyMissingArgs: Boolean) = { - def missingArgsMsg = if (possiblyMissingArgs) "\n possible cause: missing arguments for method or constructor" else "" - - "type mismatch" + foundReqMsg(found, req) + missingArgsMsg - } + def typeErrorMsg(found: Type, req: Type) = "type mismatch" + foundReqMsg(found, req) } def notAnyRefMessage(found: Type): String = { @@ -185,7 +181,7 @@ trait ContextErrors { } assert(!foundType.isErroneous && !req.isErroneous, (foundType, req)) - issueNormalTypeError(tree, withAddendum(tree.pos)(typeErrorMsg(foundType, req, infer.isPossiblyMissingArgs(foundType, req))) ) + issueNormalTypeError(tree, withAddendum(tree.pos)(typeErrorMsg(foundType, req))) infer.explainTypes(foundType, req) } @@ -901,7 +897,7 @@ trait ContextErrors { } def NoBestExprAlternativeError(tree: Tree, pt: Type, lastTry: Boolean) = { - issueNormalTypeError(tree, withAddendum(tree.pos)(typeErrorMsg(tree.symbol.tpe, pt, isPossiblyMissingArgs(tree.symbol.tpe, pt)))) + issueNormalTypeError(tree, withAddendum(tree.pos)(typeErrorMsg(tree.symbol.tpe, pt))) setErrorOnLastTry(lastTry, tree) } @@ -1165,7 +1161,7 @@ trait ContextErrors { sm"""|Note that implicit conversions are not applicable because they are ambiguous: |${coreMsg}are possible conversion functions from $found to $req""" } - typeErrorMsg(found, req, infer.isPossiblyMissingArgs(found, req)) + ( + typeErrorMsg(found, req) + ( if (explanation == "") "" else "\n" + explanation ) } -- cgit v1.2.3