diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 289515ae1..2cf4516cd 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1166,9 +1166,7 @@ object Types { TermRef.withSig(prefix, name.asTermName, sig) protected def loadDenot(implicit ctx: Context): Denotation = { - val d = - if (name.isInheritedName) prefix.nonPrivateMember(name.revertInherited) - else prefix.member(name) + val d = asMemberOf(prefix) if (d.exists || ctx.phaseId == FirstPhaseId || !lastDenotation.isInstanceOf[SymDenotation]) d else { // name has changed; try load in earlier phase and make current @@ -1178,6 +1176,10 @@ object Types { } } + protected def asMemberOf(prefix: Type)(implicit ctx: Context) = + if (name.isInheritedName) prefix.nonPrivateMember(name.revertInherited) + else prefix.member(name) + def symbol(implicit ctx: Context): Symbol = { val now = ctx.period if (checkedPeriod == now || @@ -1289,7 +1291,7 @@ object Types { sig != Signature.OverloadedSignature && symbol.exists) { val ownSym = symbol - TermRef(prefix, name).withDenot(prefix.member(name).disambiguate(_ eq ownSym)) + TermRef(prefix, name).withDenot(asMemberOf(prefix).disambiguate(_ eq ownSym)) } else TermRef.withSig(prefix, name, sig) } |