diff options
author | Paul Phillips <paulp@improving.org> | 2013-05-17 10:51:33 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-05-17 13:54:11 -0700 |
commit | dd33e280e2520cfc155c90db01c48df8188d0433 (patch) | |
tree | c32444378a84dae8762a3928c26cc55a0cb06ac0 /src | |
parent | e927cbc39a081dc0eeddc1bc264bcbe3f9b3c7d0 (diff) | |
download | scala-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')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 10 |
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, () => |