Skip to content

Commit 0d6191b

Browse files
committed
Handle shadowed refs under new scheme
1 parent 1fc78c2 commit 0d6191b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,11 @@ trait TypeAssigner {
187187
// it could be that we found an inaccessible private member, but there is
188188
// an inherited non-private member with the same name and signature.
189189
val d2 = pre.nonPrivateMember(name)
190-
if (reallyExists(d2) && firstTry && !config.Config.newScheme)
191-
test(tpe.withNameSpaceOLD(noNameSpace).withDenot(d2), false)
190+
if (reallyExists(d2) && firstTry)
191+
test(
192+
if (config.Config.newScheme) TermRef.withDenot(pre, d2)
193+
else tpe.withNameSpaceOLD(noNameSpace).withDenot(d2),
194+
false)
192195
else if (pre.derivesFrom(defn.DynamicClass)) {
193196
TryDynamicCallType
194197
} else {

0 commit comments

Comments
 (0)