@@ -1942,27 +1942,16 @@ trait Applications extends Compatibility {
19421942 def resolveOverloaded (alts : List [TermRef ], pt : Type )(using Context ): List [TermRef ] =
19431943 record(" resolveOverloaded" )
19441944
1945- /** Is `alt` a method or polytype whose approximated result type after the first value parameter
1945+ /** Is `alt` a method or polytype whose result type after the first value parameter
19461946 * section conforms to the expected type `resultType`? If `resultType`
19471947 * is a `IgnoredProto`, pick the underlying type instead.
1948- *
1949- * Using an approximated result type is necessary to avoid false negatives
1950- * due to incomplete type inference such as in tests/pos/i21410.scala and tests/pos/i21410b.scala.
19511948 */
19521949 def resultConforms (altSym : Symbol , altType : Type , resultType : Type )(using Context ): Boolean =
19531950 resultType.revealIgnored match {
19541951 case resultType : ValueType =>
19551952 altType.widen match {
19561953 case tp : PolyType => resultConforms(altSym, instantiateWithTypeVars(tp), resultType)
1957- case tp : MethodType =>
1958- val wildRes = wildApprox(tp.resultType)
1959-
1960- class ResultApprox extends AvoidWildcardsMap :
1961- // Avoid false negatives by approximating to a lower bound
1962- variance = - 1
1963-
1964- val approx = ResultApprox ()(wildRes)
1965- constrainResult(altSym, approx, resultType)
1954+ case tp : MethodType => constrainResult(altSym, tp.resultType, resultType)
19661955 case _ => true
19671956 }
19681957 case _ => true
@@ -2308,7 +2297,6 @@ trait Applications extends Compatibility {
23082297 if t.exists && alt.symbol.exists then
23092298 val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
23102299 val mappedSym = alt.symbol.asTerm.copy(info = t)
2311- mappedSym.annotations = alt.symbol.annotations
23122300 mappedSym.rawParamss = trimmed
23132301 val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match
23142302 case Some ((pre, prevSkipped)) =>
0 commit comments