@@ -867,23 +867,19 @@ object Types extends TypeUtils {
867867 }
868868 else
869869 val isRefinedMethod = rinfo.isInstanceOf [MethodOrPoly ]
870- rinfo match
871- case CapturingType (_, refs : CaptureSet .RefiningVar ) if ccConfig.optimizedRefinements =>
872- pdenot.asSingleDenotation.derivedSingleDenotation(pdenot.symbol, rinfo)
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)
873881 case _ =>
874- val joint = pdenot.meet(
875- new JointRefDenotation (NoSymbol , rinfo, Period .allInRun(ctx.runId), pre, isRefinedMethod),
876- pre,
877- safeIntersection = ctx.base.pendingMemberSearches.contains(name))
878- joint match
879- case joint : SingleDenotation
880- if isRefinedMethod
881- && (rinfo <:< joint.info
882- || name == nme.apply && defn.isFunctionType(tp.parent)) =>
883- // use `rinfo` to keep the right parameter names for named args. See i8516.scala.
884- joint.derivedSingleDenotation(joint.symbol, rinfo, pre, isRefinedMethod)
885- case _ =>
886- joint
882+ joint
887883 }
888884
889885 def goApplied (tp : AppliedType , tycon : HKTypeLambda ) =
0 commit comments