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 @@ -672,13 +672,14 @@ trait Implicits { self: Typer =>
672
672
|
673
673
| ${arg.show.replace(" \n " , " \n " )}
674
674
|
675
- |But $tpe.explanation}. """
675
+ |But ${ tpe.explanation}. """
676
676
}
677
677
}
678
+ def location (preposition : String ) = if (where.isEmpty) " " else s " $preposition $where"
678
679
arg.tpe match {
679
680
case ambi : AmbiguousImplicits =>
680
- msg(s " ambiguous implicit arguments: ${ambi.explanation} of $where " )(
681
- s " ambiguous implicit arguments of type ${pt.show} found for $where " )
681
+ msg(s " ambiguous implicit arguments: ${ambi.explanation}${location( " of " )} " )(
682
+ s " ambiguous implicit arguments of type ${pt.show} found ${location( " for " )} " )
682
683
case _ =>
683
684
val userDefined =
684
685
for {
@@ -691,7 +692,7 @@ trait Implicits { self: Typer =>
691
692
pt.typeSymbol.typeParams.map(_.name.unexpandedName.toString),
692
693
pt.argInfos)
693
694
}
694
- msg(userDefined.getOrElse(em " no implicit argument of type $pt was found for $where " ))()
695
+ msg(userDefined.getOrElse(em " no implicit argument of type $pt was found ${location( " for " )} " ))()
695
696
}
696
697
}
697
698
You can’t perform that action at this time.
0 commit comments