summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-09-01 11:19:47 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-09-01 11:19:47 +0200
commit445c2f85e1ad0e4036c93949a72902173b5fdd56 (patch)
treeb48a254b386dfb48ac1964f13a8fc85dd36c4df6 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parent78401c8220fb56ed077b99a5ffb4205c14fee736 (diff)
downloadscala-445c2f85e1ad0e4036c93949a72902173b5fdd56.tar.gz
scala-445c2f85e1ad0e4036c93949a72902173b5fdd56.tar.bz2
scala-445c2f85e1ad0e4036c93949a72902173b5fdd56.zip
More useful -Xlog-implicits output.
The test exercises the most important case, when implicits are invalidated through shadowing. (See SI-4270)
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 226e17f605..6a91922b4c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -593,7 +593,7 @@ trait Implicits {
typed1(itree, EXPRmode, wildPt)
if (context.hasErrors)
- return fail("typed implicit %s has errors".format(info.sym.fullLocationString))
+ return fail(context.errBuffer.head.errMsg)
if (Statistics.canEnable) Statistics.incCounter(typedImplicits)
@@ -615,7 +615,7 @@ trait Implicits {
}
if (context.hasErrors)
- fail("hasMatchingSymbol reported threw error(s)")
+ fail("hasMatchingSymbol reported error: " + context.errBuffer.head.errMsg)
else if (isLocal && !hasMatchingSymbol(itree1))
fail("candidate implicit %s is shadowed by %s".format(
info.sym.fullLocationString, itree1.symbol.fullLocationString))
@@ -639,7 +639,7 @@ trait Implicits {
// #2421: check that we correctly instantiated type parameters outside of the implicit tree:
checkBounds(itree2, NoPrefix, NoSymbol, undetParams, targs, "inferred ")
if (context.hasErrors)
- return fail("type parameters weren't correctly instantiated outside of the implicit tree")
+ return fail("type parameters weren't correctly instantiated outside of the implicit tree: " + context.errBuffer.head.errMsg)
// filter out failures from type inference, don't want to remove them from undetParams!
// we must be conservative in leaving type params in undetparams
@@ -675,7 +675,7 @@ trait Implicits {
}
if (context.hasErrors)
- fail("typing TypeApply reported errors for the implicit tree")
+ fail("typing TypeApply reported errors for the implicit tree: " + context.errBuffer.head.errMsg)
else {
val result = new SearchResult(itree2, subst)
if (Statistics.canEnable) Statistics.incCounter(foundImplicits)