@@ -863,23 +863,19 @@ object Types extends TypeUtils {
863863 }
864864 else
865865 val isRefinedMethod = rinfo.isInstanceOf [MethodOrPoly ]
866- rinfo match
867- case CapturingType (_, refs : CaptureSet .RefiningVar ) if ccConfig.optimizedRefinements =>
868- pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, rinfo)
866+ val joint = pdenot.meet(
867+ new JointRefDenotation (NoSymbol , rinfo, Period .allInRun(ctx.runId), pre, isRefinedMethod),
868+ pre,
869+ safeIntersection = ctx.base.pendingMemberSearches.contains(name))
870+ joint match
871+ case joint : SingleDenotation
872+ if isRefinedMethod
873+ && (rinfo <:< joint.info
874+ || name == nme.apply && defn.isFunctionType(tp.parent)) =>
875+ // use `rinfo` to keep the right parameter names for named args. See i8516.scala.
876+ joint.derivedSingleDenotation(joint.symbol, rinfo, pre, isRefinedMethod)
869877 case _ =>
870- val joint = pdenot.meet(
871- new JointRefDenotation (NoSymbol , rinfo, Period .allInRun(ctx.runId), pre, isRefinedMethod),
872- pre,
873- safeIntersection = ctx.base.pendingMemberSearches.contains(name))
874- joint match
875- case joint : SingleDenotation
876- if isRefinedMethod
877- && (rinfo <:< joint.info
878- || name == nme.apply && defn.isFunctionType(tp.parent)) =>
879- // use `rinfo` to keep the right parameter names for named args. See i8516.scala.
880- joint.derivedSingleDenotation(joint.symbol, rinfo, pre, isRefinedMethod)
881- case _ =>
882- joint
878+ joint
883879 }
884880
885881 def goApplied (tp : AppliedType , tycon : HKTypeLambda ) =
0 commit comments