File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
compiler/src/dotty/tools/dotc/reporting/diagnostic Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -315,10 +315,12 @@ object messages {
315315 val msg : String = {
316316 import core .Flags ._
317317 val maxDist = 3
318- val decls = site.decls.toList.flatMap { sym =>
319- if (sym.flagsUNSAFE.isOneOf(Synthetic | PrivateLocal ) || sym.isConstructor) Nil
320- else List ((sym.name.show, sym))
321- }
318+ val decls = site.decls.toList
319+ .filter(_.isType == name.isTypeName)
320+ .flatMap { sym =>
321+ if (sym.flagsUNSAFE.isOneOf(Synthetic | PrivateLocal ) || sym.isConstructor) Nil
322+ else List ((sym.name.show, sym))
323+ }
322324
323325 // Calculate Levenshtein distance
324326 def distance (n1 : Iterable [_], n2 : Iterable [_]) =
@@ -358,7 +360,8 @@ object messages {
358360 }
359361
360362 val closeMember = closest match {
361- case (n, sym) :: Nil => s " - did you mean $siteName. $n? "
363+ case (n, sym) :: Nil =>
364+ s " - did you mean $siteName. $n? "
362365 case Nil => " "
363366 case _ => assert(
364367 false ,
Original file line number Diff line number Diff line change 1+ enum Foo [T ] {
2+ case Bar (s : String )
3+ case Baz extends Foo [Int ]
4+ }
5+
6+ object Main {
7+ def f (foo : Foo .Baz ): Foo [_] = foo
8+ }
You can’t perform that action at this time.
0 commit comments