Skip to content

Commit 8289d51

Browse files
committed
Don't mention evidence$n parameters in error message
1 parent 5ac8b80 commit 8289d51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Flags._
1414
import TypeErasure.{erasure, hasStableErasure}
1515
import Mode.ImplicitsEnabled
1616
import NameOps._
17-
import NameKinds.LazyImplicitName
17+
import NameKinds.{LazyImplicitName, EvidenceParamName}
1818
import Symbols._
1919
import Denotations._
2020
import Types._
@@ -1265,7 +1265,8 @@ trait Implicits { self: Typer =>
12651265
def addendum = if (qt1 eq qt) "" else (i"\nwhich is an alias of: $qt1")
12661266
em"parameter of ${qual.tpe.widen}$addendum"
12671267
case _ =>
1268-
em"parameter ${paramName} of $methodStr"
1268+
em"${ if paramName.is(EvidenceParamName) then "an implicit parameter"
1269+
else s"parameter $paramName" } of $methodStr"
12691270
}
12701271

12711272
private def strictEquality(implicit ctx: Context): Boolean =

tests/neg/missing-implicit1.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-- Error: tests/neg/missing-implicit1.scala:23:42 ----------------------------------------------------------------------
2020
23 | List(1, 2, 3).traverse(x => Option(x)) // error
2121
| ^
22-
|no implicit argument of type testObjectInstance.Zip[Option] was found for parameter evidence$1 of method traverse in trait Traverse
22+
|no implicit argument of type testObjectInstance.Zip[Option] was found for an implicit parameter of method traverse in trait Traverse
2323
|
2424
|The following import might fix the problem:
2525
|
@@ -68,7 +68,7 @@
6868
-- Error: tests/neg/missing-implicit1.scala:50:42 ----------------------------------------------------------------------
6969
50 | List(1, 2, 3).traverse(x => Option(x)) // error
7070
| ^
71-
|no implicit argument of type Zip[Option] was found for parameter evidence$2 of method traverse in trait Traverse
71+
|no implicit argument of type Zip[Option] was found for an implicit parameter of method traverse in trait Traverse
7272
|
7373
|The following import might fix the problem:
7474
|

0 commit comments

Comments
 (0)