File tree 2 files changed +20
-4
lines changed
src/dotty/tools/dotc/core
2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1166,9 +1166,7 @@ object Types {
1166
1166
TermRef .withSig(prefix, name.asTermName, sig)
1167
1167
1168
1168
protected def loadDenot (implicit ctx : Context ): Denotation = {
1169
- val d =
1170
- if (name.isInheritedName) prefix.nonPrivateMember(name.revertInherited)
1171
- else prefix.member(name)
1169
+ val d = asMemberOf(prefix)
1172
1170
if (d.exists || ctx.phaseId == FirstPhaseId || ! lastDenotation.isInstanceOf [SymDenotation ])
1173
1171
d
1174
1172
else { // name has changed; try load in earlier phase and make current
@@ -1178,6 +1176,10 @@ object Types {
1178
1176
}
1179
1177
}
1180
1178
1179
+ protected def asMemberOf (prefix : Type )(implicit ctx : Context ) =
1180
+ if (name.isInheritedName) prefix.nonPrivateMember(name.revertInherited)
1181
+ else prefix.member(name)
1182
+
1181
1183
def symbol (implicit ctx : Context ): Symbol = {
1182
1184
val now = ctx.period
1183
1185
if (checkedPeriod == now ||
@@ -1289,7 +1291,7 @@ object Types {
1289
1291
sig != Signature .OverloadedSignature &&
1290
1292
symbol.exists) {
1291
1293
val ownSym = symbol
1292
- TermRef (prefix, name).withDenot(prefix.member(name ).disambiguate(_ eq ownSym))
1294
+ TermRef (prefix, name).withDenot(asMemberOf(prefix ).disambiguate(_ eq ownSym))
1293
1295
}
1294
1296
else TermRef .withSig(prefix, name, sig)
1295
1297
}
Original file line number Diff line number Diff line change
1
+ package dotty .tools .dotc
2
+ package transform
3
+
4
+ import dotty .tools .dotc .core .Denotations ._
5
+ import dotty .tools .dotc .core .Symbols ._
6
+ import dotty .tools .dotc .core .Contexts ._
7
+
8
+ class TC5 extends AnyVal {
9
+ implicit val ctx : Context = ???
10
+
11
+ def candidates (mbr : SingleDenotation ): Boolean = {
12
+ mbr.symbol.denot(ctx).exists
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments