File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -671,13 +671,14 @@ trait Implicits { self: Typer =>
671
671
|
672
672
| ${arg.show.replace(" \n " , " \n " )}
673
673
|
674
- |But $tpe.explanation}. """
674
+ |But ${ tpe.explanation}. """
675
675
}
676
676
}
677
+ def location (preposition : String ) = if (where.isEmpty) " " else s " $preposition $where"
677
678
arg.tpe match {
678
679
case ambi : AmbiguousImplicits =>
679
- msg(s " ambiguous implicit arguments: ${ambi.explanation} of $where " )(
680
- s " ambiguous implicit arguments of type ${pt.show} found for $where " )
680
+ msg(s " ambiguous implicit arguments: ${ambi.explanation}${location( " of " )} " )(
681
+ s " ambiguous implicit arguments of type ${pt.show} found ${location( " for " )} " )
681
682
case _ =>
682
683
val userDefined =
683
684
for {
@@ -690,7 +691,7 @@ trait Implicits { self: Typer =>
690
691
pt.typeSymbol.typeParams.map(_.name.unexpandedName.toString),
691
692
pt.argInfos)
692
693
}
693
- msg(userDefined.getOrElse(em " no implicit argument of type $pt was found for $where " ))()
694
+ msg(userDefined.getOrElse(em " no implicit argument of type $pt was found ${location( " for " )} " ))()
694
695
}
695
696
}
696
697
You can’t perform that action at this time.
0 commit comments