summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-05-27 06:35:37 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-05-27 06:35:37 -0700
commit6cc39842f79bcf266ca3f49eca1f2a1ba46ed817 (patch)
treecf7678821c44fad81c5c58d2afefb4141eee6604
parent0da2b2c96b6dc91d95a54725bc04381fc0eda43b (diff)
parentde12ca6ef8071820c6b2a9403ccab9aa6ed51c0b (diff)
downloadscala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.tar.gz
scala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.tar.bz2
scala-6cc39842f79bcf266ca3f49eca1f2a1ba46ed817.zip
Merge pull request #2590 from paulp/issue/7486
SI-7486 Regressions in implicit search.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala17
-rw-r--r--test/pending/neg/t7441.check (renamed from test/files/neg/t7441.check)0
-rw-r--r--test/pending/neg/t7441.scala (renamed from test/files/neg/t7441.scala)0
-rw-r--r--test/pending/pos/t7486.scala (renamed from test/files/pos/t7486.scala)0
4 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
diff --git a/test/files/neg/t7441.check b/test/pending/neg/t7441.check
index f259457197..f259457197 100644
--- a/test/files/neg/t7441.check
+++ b/test/pending/neg/t7441.check
diff --git a/test/files/neg/t7441.scala b/test/pending/neg/t7441.scala
index dad7421e3f..dad7421e3f 100644
--- a/test/files/neg/t7441.scala
+++ b/test/pending/neg/t7441.scala
diff --git a/test/files/pos/t7486.scala b/test/pending/pos/t7486.scala
index 6dd7f4c4ac..6dd7f4c4ac 100644
--- a/test/files/pos/t7486.scala
+++ b/test/pending/pos/t7486.scala