File tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2503,17 +2503,17 @@ object Types {
2503
2503
* might depend on the given prefix.
2504
2504
* Note: If T is an abstract type in trait or class C, its info depends
2505
2505
* even on C.this if class C has a self type that refines the info of T.
2506
- * Currently, "refines" means an actual refinement type that constrains the
2507
- * name `T`. We should try to extend that also to other classes that introduce
2508
- * a new bining for `T`. Furthermore, we should also treat term members
2509
- * in this way.
2506
+ * We should also treat term members in this way.
2510
2507
*/
2511
2508
private def infoDependsOnPrefix (symd : SymDenotation , prefix : Type )(using Context ): Boolean =
2512
2509
2513
2510
def refines (tp : Type , name : Name ): Boolean = tp match
2514
2511
case AndType (tp1, tp2) => refines(tp1, name) || refines(tp2, name)
2515
2512
case RefinedType (parent, rname, _) => rname == name || refines(parent, name)
2516
- case tp : RecType => refines(tp.parent, name)
2513
+ case tp : ClassInfo =>
2514
+ val other = tp.cls.infoOrCompleter.nonPrivateMember(name)
2515
+ other.exists && other.symbol != symd.symbol
2516
+ case tp : TypeProxy => refines(tp.underlying, name)
2517
2517
case _ => false
2518
2518
2519
2519
def givenSelfTypeOrCompleter (cls : Symbol ) = cls.infoOrCompleter match
You can’t perform that action at this time.
0 commit comments