summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-23 16:50:45 -0700
committerPaul Phillips <paulp@improving.org>2013-05-23 23:18:42 -0700
commitde12ca6ef8071820c6b2a9403ccab9aa6ed51c0b (patch)
tree20da62ee1cb063a60b7a7e4fa2d9081e11093265 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parentf81a4f92967a2dd69784864e9ab9e1624d7db35b (diff)
downloadscala-de12ca6ef8071820c6b2a9403ccab9aa6ed51c0b.tar.gz
scala-de12ca6ef8071820c6b2a9403ccab9aa6ed51c0b.tar.bz2
scala-de12ca6ef8071820c6b2a9403ccab9aa6ed51c0b.zip
SI-7486 Regressions in implicit search.
Revert e86832d7e8 and dd33e280e2.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index ef87a32c1d..35a4461ccc 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -997,22 +997,11 @@ trait Implicits {
if (settings.Xdivergence211.value) DivergingImplicitExpansionError(tree, pt, DivergentImplicitRecovery.sym)(context)
else throw DivergentImplicit
}
- else if (invalidImplicits.nonEmpty) {
- val sym = invalidImplicits.head
- // We don't even dare look if errors are being buffered
- // !sym.hasFlag(LOCKED) is a hail mary between SI-2206 and SI-7486
- def isSensibleAddendum = !sym.hasFlag(LOCKED) && (pt match {
- case Function1(_, out) => out <:< sym.tpe.finalResultType
- case _ => pt <:< sym.tpe.finalResultType
- })
- // Don't pitch in with this theory unless it looks plausible that the
- // implicit would have helped
+
+ if (invalidImplicits.nonEmpty)
setAddendum(pos, () =>
- if (isSensibleAddendum)
- s"\n Note: implicit $sym is not applicable here because it comes after the application point and it lacks an explicit result type"
- else ""
+ s"\n Note: implicit ${invalidImplicits.head} is not applicable here because it comes after the application point and it lacks an explicit result type"
)
- }
}
best