diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-09-18 18:06:59 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-09-23 13:23:24 -0700 |
commit | 69ce27434e07c8dc215490256fe51622d768dd7e (patch) | |
tree | 827d13297d325a51af6f16ed856734a2e1583a39 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | 7d570b54c3c895bc8948adeca2e463d135e38feb (diff) | |
download | scala-69ce27434e07c8dc215490256fe51622d768dd7e.tar.gz scala-69ce27434e07c8dc215490256fe51622d768dd7e.tar.bz2 scala-69ce27434e07c8dc215490256fe51622d768dd7e.zip |
SI-7848 Xlint no warn on $sym with params
This idea brought to you by retronym.
Also improve implicitNotFound detection at typer;
and avoid checking the standard interpolation
expression for cases like s"some $$x".
Some minor refactorings of implicitNotFound strings.
The intersobralator allows extra spaces, i.e., trims.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 1f4d5cbac2..0f7fb98e66 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -145,12 +145,15 @@ trait ContextErrors { def errMsg = { val paramName = param.name val paramTp = param.tpe + def evOrParam = ( + if (paramName startsWith nme.EVIDENCE_PARAM_PREFIX) + "evidence parameter of type" + else + s"parameter $paramName:" + ) paramTp.typeSymbolDirect match { - case ImplicitNotFoundMsg(msg) => msg.format(paramName, paramTp) - case _ => - "could not find implicit value for "+ - (if (paramName startsWith nme.EVIDENCE_PARAM_PREFIX) "evidence parameter of type " - else "parameter "+paramName+": ")+paramTp + case ImplicitNotFoundMsg(msg) => msg.format(paramName, paramTp) + case _ => s"could not find implicit value for $evOrParam $paramTp" } } issueNormalTypeError(tree, errMsg) |