@@ -860,21 +860,24 @@ object Types extends TypeUtils {
860
860
pinfo recoverable_& rinfo
861
861
pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, jointInfo)
862
862
}
863
- else
864
- val isRefinedMethod = rinfo.isInstanceOf [MethodOrPoly ]
865
- val joint = pdenot.meet(
866
- new JointRefDenotation (NoSymbol , rinfo, Period .allInRun(ctx.runId), pre, isRefinedMethod),
867
- pre,
868
- safeIntersection = ctx.base.pendingMemberSearches.contains(name))
869
- joint match
870
- case joint : SingleDenotation
871
- if isRefinedMethod
872
- && (rinfo <:< joint.info
873
- || name == nme.apply && defn.isFunctionType(tp.parent)) =>
874
- // use `rinfo` to keep the right parameter names for named args. See i8516.scala.
875
- joint.derivedSingleDenotation(joint.symbol, rinfo, pre, isRefinedMethod)
876
- case _ =>
877
- joint
863
+ else rinfo match
864
+ case AnnotatedType (rinfo1, ann) if ann.symbol == defn.RefineOverrideAnnot =>
865
+ pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, rinfo1)
866
+ case _ =>
867
+ val isRefinedMethod = rinfo.isInstanceOf [MethodOrPoly ]
868
+ val joint = pdenot.meet(
869
+ new JointRefDenotation (NoSymbol , rinfo, Period .allInRun(ctx.runId), pre, isRefinedMethod),
870
+ pre,
871
+ safeIntersection = ctx.base.pendingMemberSearches.contains(name))
872
+ joint match
873
+ case joint : SingleDenotation
874
+ if isRefinedMethod
875
+ && (rinfo <:< joint.info
876
+ || name == nme.apply && defn.isFunctionType(tp.parent)) =>
877
+ // use `rinfo` to keep the right parameter names for named args. See i8516.scala.
878
+ joint.derivedSingleDenotation(joint.symbol, rinfo, pre, isRefinedMethod)
879
+ case _ =>
880
+ joint
878
881
}
879
882
880
883
def goApplied (tp : AppliedType , tycon : HKTypeLambda ) =
0 commit comments