@@ -15,7 +15,7 @@ import printing.Formatting
1515import ErrorMessageID ._
1616import ast .Trees
1717import config .{Feature , ScalaVersion }
18- import typer .ErrorReporting .{ Errors , err }
18+ import typer .ErrorReporting .err
1919import typer .ProtoTypes .ViewProto
2020import scala .util .control .NonFatal
2121import StdNames .nme
@@ -1308,14 +1308,13 @@ object messages {
13081308
13091309 }
13101310
1311- class AmbiguousOverload (tree : tpd.Tree , val alternatives : List [SingleDenotation ], pt : Type )(
1312- err : Errors )(
1311+ class AmbiguousOverload (tree : tpd.Tree , val alternatives : List [SingleDenotation ], pt : Type , addendum : String = " " )(
13131312 implicit ctx : Context )
13141313 extends ReferenceMsg (AmbiguousOverloadID ) {
13151314 private def all = if (alternatives.length == 2 ) " both" else " all"
13161315 def msg =
1317- s """ |Ambiguous overload. The ${err.overloadedAltsStr(alternatives)}
1318- | $all match ${err.expectedTypeStr(pt)}""" .stripMargin
1316+ em """ |Ambiguous overload. The ${err.overloadedAltsStr(alternatives)}
1317+ | $all match ${err.expectedTypeStr(pt)}$addendum """ .stripMargin
13191318 def explain =
13201319 em """ |There are ${alternatives.length} methods that could be referenced as the compiler knows too little
13211320 |about the expected type.
@@ -1389,8 +1388,7 @@ object messages {
13891388 def explain = em " A fully applied type is expected but $tpe takes $numParams $parameters"
13901389 }
13911390
1392- class DoesNotConformToBound (tpe : Type , which : String , bound : Type )(
1393- err : Errors )(implicit ctx : Context )
1391+ class DoesNotConformToBound (tpe : Type , which : String , bound : Type )(implicit ctx : Context )
13941392 extends TypeMismatchMsg (DoesNotConformToBoundID ) {
13951393 def msg = em " Type argument ${tpe} does not conform to $which bound $bound${err.whyNoMatchStr(tpe, bound)}"
13961394 def explain = " "
@@ -2141,8 +2139,7 @@ object messages {
21412139 |Refinements cannot contain overloaded definitions. """ .stripMargin
21422140 }
21432141
2144- class NoMatchingOverload (val alternatives : List [SingleDenotation ], pt : Type )(
2145- err : Errors )(using ctx : Context )
2142+ class NoMatchingOverload (val alternatives : List [SingleDenotation ], pt : Type )(using ctx : Context )
21462143 extends TypeMismatchMsg (NoMatchingOverloadID ) {
21472144 def msg =
21482145 em """ None of the ${err.overloadedAltsStr(alternatives)}
0 commit comments