Skip to content

Commit ad5055b

Browse files
committed
Further refinement of "did you mean" hints
1 parent 717cb7d commit ad5055b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ object messages {
347347
decls
348348
.map { (n, sym) => (n, distance(n, name.show), sym) }
349349
.collect {
350-
case (n, dist, sym) if dist <= maxDist && dist < name.toString.length => (n, dist, sym)
350+
case (n, dist, sym)
351+
if dist <= maxDist && dist < (name.toString.length min n.length) =>
352+
(n, dist, sym)
351353
}
352354
.groupBy(_._2).toList
353355
.sortBy(_._1)

0 commit comments

Comments
 (0)