File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,13 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
268
268
if (qualifies(defDenot)) {
269
269
val found =
270
270
if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType
271
- else curOwner.thisType.select(name, defDenot)
271
+ else {
272
+ val effectiveOwner =
273
+ if (curOwner.isTerm && defDenot.symbol.maybeOwner.isType) defDenot.symbol.owner
274
+ else curOwner
275
+ // println(i"typed ID $name in $curOwner, ${defDenot.symbol.owner}")
276
+ effectiveOwner.thisType.select(name, defDenot)
277
+ }
272
278
if (! (curOwner is Package ) || isDefinedInCurrentUnit(defDenot))
273
279
result = checkNewOrShadowed(found, definition) // no need to go further out, we found highest prec entry
274
280
else {
You can’t perform that action at this time.
0 commit comments