Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Fix tests broken by @implicitAmbiguous updates
Browse files Browse the repository at this point in the history
  • Loading branch information
puffnfresh committed Sep 8, 2014
1 parent 922e8e8 commit 997c9d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1195,13 +1195,14 @@ trait ContextErrors {

import definitions._

def AmbiguousImplicitError(tree1: Tree, tree2: Tree,
def AmbiguousImplicitError(info1: ImplicitInfo, tree1: Tree,
info2: ImplicitInfo, tree2: Tree,
pre1: String, pre2: String, trailer: String)
(isView: Boolean, pt: Type, tree: Tree)(implicit context0: Context) = {
if (!tree2.tpe.isErroneous && !tree2.tpe.isErroneous) {
if (!info1.tpe.isErroneous && !info2.tpe.isErroneous) {
def coreMsg =
sm"""| $pre1 ${tree1.symbol.fullLocationString} of type ${tree1.symbol.tpe}
| $pre2 ${tree2.symbol.fullLocationString} of type ${tree2.symbol.tpe}
sm"""| $pre1 ${info1.sym.fullLocationString} of type ${info1.tpe}
| $pre2 ${info2.sym.fullLocationString} of type ${info2.tpe}
| $trailer"""
def viewMsg = {
val found :: req :: _ = pt.typeArgs
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/typechecker/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,8 @@ trait Implicits {
case Nil => ()
case (chosenResult, chosenInfo) :: rest =>
rest find { case (_, alt) => !improves(chosenInfo, alt) } match {
case Some((competingResult, _)) =>
AmbiguousImplicitError(chosenResult.tree, competingResult.tree, "both", "and", "")(isView, pt, tree)(context)
case Some((competingResult, competingInfo)) =>
AmbiguousImplicitError(chosenInfo, chosenResult.tree, competingInfo, competingResult.tree, "both", "and", "")(isView, pt, tree)(context)
return AmbiguousSearchFailure // Stop the search once ambiguity is encountered, see t4457_2.scala
case _ =>
if (isView) chosenInfo.useCountView += 1
Expand Down

0 comments on commit 997c9d4

Please sign in to comment.