diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-05-27 06:35:37 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-05-27 06:35:37 -0700 |
commit | 6cc39842f79bcf266ca3f49eca1f2a1ba46ed817 (patch) | |
tree | cf7678821c44fad81c5c58d2afefb4141eee6604 /src | |
parent | 0da2b2c96b6dc91d95a54725bc04381fc0eda43b (diff) | |
parent | de12ca6ef8071820c6b2a9403ccab9aa6ed51c0b (diff) | |
download | scala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.tar.gz scala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.tar.bz2 scala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.zip |
Merge pull request #2590 from paulp/issue/7486
SI-7486 Regressions in implicit search.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 17 |
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 |