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 ++++-------- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 10 ---------- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'src/compiler/scala/tools') 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 ) } diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 85533adbc6..b213d0fa1b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -291,16 +291,6 @@ trait Infer extends Checkable { def issue(err: AbsTypeError): Unit = context.issue(err) - def isPossiblyMissingArgs(found: Type, req: Type) = ( - false - /* However it is that this condition is expected to imply - * "is possibly missing args", it is too weak. It is - * better to say nothing than to offer misleading guesses. - - * (found.resultApprox ne found) && isWeaklyCompatible(found.resultApprox, req) - */ - ) - def explainTypes(tp1: Type, tp2: Type) = { if (context.reportErrors) withDisambiguation(List(), tp1, tp2)(global.explainTypes(tp1, tp2)) -- cgit v1.2.3