Skip to content

Commit

Permalink
Backport "bugfix: add moduleClass imported symbols in `IndexedConte…
Browse files Browse the repository at this point in the history
…xt`" to LTS (#20629)

Backports #18620 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jun 20, 2024
2 parents bb55300 + a53e04e commit b29dccb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import scala.util.control.NonFatal

import dotty.tools.dotc.core.Contexts.*
import dotty.tools.dotc.core.Flags.*
import dotty.tools.dotc.core.NameOps.moduleClassName
import dotty.tools.dotc.core.Names.*
import dotty.tools.dotc.core.Symbols.*
import dotty.tools.dotc.core.Types.*
Expand Down Expand Up @@ -170,7 +171,11 @@ object IndexedContext:
initial ++ fromPackageObjects

def fromImport(site: Type, name: Name)(using Context): List[Symbol] =
List(site.member(name.toTypeName), site.member(name.toTermName))
List(
site.member(name.toTypeName),
site.member(name.toTermName),
site.member(name.moduleClassName),
)
.flatMap(_.alternatives)
.map(_.symbol)

Expand Down

0 comments on commit b29dccb

Please # to comment.