summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-17 10:51:33 -0700
committerPaul Phillips <paulp@improving.org>2013-05-17 13:54:11 -0700
commitdd33e280e2520cfc155c90db01c48df8188d0433 (patch)
treec32444378a84dae8762a3928c26cc55a0cb06ac0 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parente927cbc39a081dc0eeddc1bc264bcbe3f9b3c7d0 (diff)
downloadscala-dd33e280e2520cfc155c90db01c48df8188d0433.tar.gz
scala-dd33e280e2520cfc155c90db01c48df8188d0433.tar.bz2
scala-dd33e280e2520cfc155c90db01c48df8188d0433.zip
SI-7486 regression in implicit resolution.
What a touchy beast the compiler is.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 770aef5d61..ef87a32c1d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -996,11 +996,15 @@ trait Implicits {
if (divergence || DivergentImplicitRecovery.sym != null) {
if (settings.Xdivergence211.value) DivergingImplicitExpansionError(tree, pt, DivergentImplicitRecovery.sym)(context)
else throw DivergentImplicit
- } else invalidImplicits take 1 foreach { sym =>
- def isSensibleAddendum = pt match {
+ }
+ 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
setAddendum(pos, () =>