@@ -2167,27 +2167,16 @@ trait Applications extends Compatibility {
2167
2167
def resolveOverloaded (alts : List [TermRef ], pt : Type )(using Context ): List [TermRef ] =
2168
2168
record(" resolveOverloaded" )
2169
2169
2170
- /** Is `alt` a method or polytype whose approximated result type after the first value parameter
2170
+ /** Is `alt` a method or polytype whose result type after the first value parameter
2171
2171
* section conforms to the expected type `resultType`? If `resultType`
2172
2172
* is a `IgnoredProto`, pick the underlying type instead.
2173
- *
2174
- * Using an approximated result type is necessary to avoid false negatives
2175
- * due to incomplete type inference such as in tests/pos/i21410.scala and tests/pos/i21410b.scala.
2176
2173
*/
2177
2174
def resultConforms (altSym : Symbol , altType : Type , resultType : Type )(using Context ): Boolean =
2178
2175
resultType.revealIgnored match {
2179
2176
case resultType : ValueType =>
2180
2177
altType.widen match {
2181
2178
case tp : PolyType => resultConforms(altSym, instantiateWithTypeVars(tp), resultType)
2182
- case tp : MethodType =>
2183
- val wildRes = wildApprox(tp.resultType)
2184
-
2185
- class ResultApprox extends AvoidWildcardsMap :
2186
- // Avoid false negatives by approximating to a lower bound
2187
- variance = - 1
2188
-
2189
- val approx = ResultApprox ()(wildRes)
2190
- constrainResult(altSym, approx, resultType)
2179
+ case tp : MethodType => constrainResult(altSym, tp.resultType, resultType)
2191
2180
case _ => true
2192
2181
}
2193
2182
case _ => true
@@ -2559,7 +2548,6 @@ trait Applications extends Compatibility {
2559
2548
if t.exists && alt.symbol.exists then
2560
2549
val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
2561
2550
val mappedSym = alt.symbol.asTerm.copy(info = t)
2562
- mappedSym.annotations = alt.symbol.annotations
2563
2551
mappedSym.rawParamss = trimmed
2564
2552
val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match
2565
2553
case Some ((pre, prevSkipped)) =>
0 commit comments