Skip to content

Commit 0f895a1

Browse files
author
changvvb
committed
Use companionModule where search modules
1 parent e75e9ed commit 0f895a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/core/ContextOps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ object ContextOps:
4949

5050
val preSym = pre.typeSymbol
5151

52-
// 1. Try to search in current type and parents
52+
// 1. Try to search in current type and parents.
5353
val directSearch = pre.findMember(name, pre, required, excluded)
5454

55-
// 2. Try to search in companion class if current is an object
55+
// 2. Try to search in companion class if current is an object.
5656
def searchCompanionClass = if preSym.is(Flags.Module) then
5757
preSym.companionClass.thisType.findMember(name, pre, required, excluded)
5858
else NoDenotation
@@ -69,7 +69,7 @@ object ContextOps:
6969
preSym.asClass.baseClasses
7070

7171
toSearch.iterator.map { bc =>
72-
val pre1 = bc.thisType.typeSymbol.companionClass.thisType
72+
val pre1 = bc.companionModule.namedType
7373
pre1.findMember(name, pre1, required, excluded)
7474
}.find(_.exists).getOrElse(NoDenotation)
7575

0 commit comments

Comments
 (0)