Skip to content

Commit c1b5150

Browse files
committed
Avoid printing same extension method attempt multiple times
1 parent 8529885 commit c1b5150

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ object ErrorReporting {
157157
if qualType.derivesFrom(defn.DynamicClass) then
158158
"\npossible cause: maybe a wrong Dynamic method signature?"
159159
else if attempts.nonEmpty then
160+
val attemptStrings = attempts.map(_.showIndented(4)).distinct
160161
val extMethods =
161-
if attempts.length > 1 then "Extension methods were"
162+
if attemptStrings.length > 1 then "Extension methods were"
162163
else "An extension method was"
163-
val attemptStrings = attempts.map(_.showIndented(4))
164164
i""".
165165
|$extMethods tried, but could not be fully constructed:
166166
|

0 commit comments

Comments
 (0)