@@ -45,14 +45,21 @@ object Implicits {
4545 protected def filterMatching (pt : Type )(implicit ctx : Context ): List [TermRef ] = track(" filterMatching" ) {
4646
4747 def refMatches (ref : TermRef )(implicit ctx : Context ) = {
48-
48+
4949 def discardForView (tpw : Type , argType : Type ): Boolean = tpw match {
50- case tpw : MethodType =>
51- tpw.isImplicit ||
52- tpw.paramTypes.length != 1 ||
53- ! (argType <:< tpw.paramTypes.head)(ctx.fresh.withExploreTyperState)
54- case tpw : PolyType =>
55- discardForView((new WildApprox ) apply tpw.resultType, argType)
50+ case mt : MethodType =>
51+ mt.isImplicit ||
52+ mt.paramTypes.length != 1 ||
53+ ! (argType <:< mt.paramTypes.head)(ctx.fresh.withExploreTyperState)
54+ case poly : PolyType =>
55+ poly.resultType match {
56+ case mt : MethodType =>
57+ mt.isImplicit ||
58+ mt.paramTypes.length != 1 ||
59+ ! (argType <:< ((new WildApprox ) apply mt.paramTypes.head))(ctx.fresh.withExploreTyperState)
60+ case rtp =>
61+ discardForView((new WildApprox ) apply rtp, argType)
62+ }
5663 case tpw : TermRef =>
5764 false // can't discard overloaded refs
5865 case tpw =>
@@ -65,7 +72,7 @@ object Implicits {
6572 true
6673 }
6774 }
68-
75+
6976 def discardForValueType (tpw : Type ): Boolean = tpw match {
7077 case mt : MethodType => ! mt.isImplicit
7178 case mt : PolyType => discardForValueType(tpw.resultType)
@@ -74,7 +81,7 @@ object Implicits {
7481
7582 def discard = pt match {
7683 case pt : ViewProto => discardForView(ref.widen, pt.argType)
77- case _ : ValueType => ! defn.isFunctionType(pt) && discardForValueType(ref.widen)
84+ case _ : ValueType => ! defn.isFunctionType(pt) && discardForValueType(ref.widen)
7885 case _ => false
7986 }
8087
@@ -146,7 +153,7 @@ object Implicits {
146153 }
147154 }
148155
149- private def computeEligible (tp : Type ): List [TermRef ] = ctx.traceIndented(i " computeEligible $tp in $refs%, % " , implicitsDetailed) {
156+ private def computeEligible (tp : Type ): List [TermRef ] = /* >|> */ ctx.traceIndented(i " computeEligible $tp in $refs%, % " , implicitsDetailed) /* <|< */ {
150157 if (monitored) record(s " check eligible refs in ctx " , refs.length)
151158 val ownEligible = filterMatching(tp)
152159 if (outerCtx == NoContext ) ownEligible
0 commit comments