diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-04 19:53:32 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-04 19:53:32 +0100 |
commit | b67f8e57f4381024c0fba109ebe11d4006472d83 (patch) | |
tree | a71d15a5c71202f68db01242db19093c89876c11 /src/compiler | |
parent | 8d25d05e9bf848d763e7b657d9c7e96ea5cb8daf (diff) | |
download | scala-b67f8e57f4381024c0fba109ebe11d4006472d83.tar.gz scala-b67f8e57f4381024c0fba109ebe11d4006472d83.tar.bz2 scala-b67f8e57f4381024c0fba109ebe11d4006472d83.zip |
[nomerge] SI-6667 Demote a new ambiguity error to a lint warning.
In the interests of not breaking source compability.
A few projects are relying on this bug.
Should not be merged to master.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index ec3a0a0ef7..d1cf9b1904 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1319,12 +1319,17 @@ trait Implicits { // `materializeImplicit` does some preprocessing for `pt` // is it only meant for manifests/tags or we need to do the same for `implicitsOfExpectedType`? - if (result.isFailure && !wasAmbigious) result = searchImplicit(implicitsOfExpectedType, false) + if (result.isFailure) result = searchImplicit(implicitsOfExpectedType, false) if (result.isFailure) { context.updateBuffer(previousErrs) if (Statistics.canEnable) Statistics.stopTimer(oftypeFailNanos, failstart) } else { + if (wasAmbigious && settings.lint.value) + reporter.warning(tree.pos, + "Search of in-scope implicits was ambiguous, and the implicit scope was searched. In Scala 2.11.0, this code will not compile. See SI-6667. \n" + + previousErrs.map(_.errMsg).mkString("\n")) + if (Statistics.canEnable) Statistics.stopTimer(oftypeSucceedNanos, succstart) if (Statistics.canEnable) Statistics.incCounter(oftypeImplicitHits) } |