Skip to content

Commit 3a50be9

Browse files
committed
Fix import suggestions to not bail on StubInfos
1 parent d151881 commit 3a50be9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package typer
44

55
import core._
66
import Contexts._, Types._, Symbols._, Names._, Decorators._, ProtoTypes._
7-
import Flags._
7+
import Flags._, SymDenotations._
88
import NameKinds.FlatName
99
import config.Printers.implicits
1010
import util.Spans.Span
@@ -82,8 +82,11 @@ trait ImportSuggestions:
8282
|| refSym == defn.JavaLangPackageClass // ... or java.lang.
8383
then Nil
8484
else refSym.info.decls.filter(lookInside)
85+
else if refSym.infoOrCompleter.isInstanceOf[StubInfo] then
86+
Nil // Don't chase roots that do not exist
8587
else
86-
if !refSym.is(Touched) then refSym.ensureCompleted() // JavaDefined is reliably known only after completion
88+
if !refSym.is(Touched) then
89+
refSym.ensureCompleted() // JavaDefined is reliably known only after completion
8790
if refSym.is(JavaDefined) then Nil
8891
else nestedRoots(site)
8992
nested

0 commit comments

Comments
 (0)