@@ -2140,27 +2140,16 @@ trait Applications extends Compatibility {
2140
2140
def resolveOverloaded (alts : List [TermRef ], pt : Type )(using Context ): List [TermRef ] =
2141
2141
record(" resolveOverloaded" )
2142
2142
2143
- /** Is `alt` a method or polytype whose approximated result type after the first value parameter
2143
+ /** Is `alt` a method or polytype whose result type after the first value parameter
2144
2144
* section conforms to the expected type `resultType`? If `resultType`
2145
2145
* is a `IgnoredProto`, pick the underlying type instead.
2146
- *
2147
- * Using an approximated result type is necessary to avoid false negatives
2148
- * due to incomplete type inference such as in tests/pos/i21410.scala and tests/pos/i21410b.scala.
2149
2146
*/
2150
2147
def resultConforms (altSym : Symbol , altType : Type , resultType : Type )(using Context ): Boolean =
2151
2148
resultType.revealIgnored match {
2152
2149
case resultType : ValueType =>
2153
2150
altType.widen match {
2154
2151
case tp : PolyType => resultConforms(altSym, instantiateWithTypeVars(tp), resultType)
2155
- case tp : MethodType =>
2156
- val wildRes = wildApprox(tp.resultType)
2157
-
2158
- class ResultApprox extends AvoidWildcardsMap :
2159
- // Avoid false negatives by approximating to a lower bound
2160
- variance = - 1
2161
-
2162
- val approx = ResultApprox ()(wildRes)
2163
- constrainResult(altSym, approx, resultType)
2152
+ case tp : MethodType => constrainResult(altSym, tp.resultType, resultType)
2164
2153
case _ => true
2165
2154
}
2166
2155
case _ => true
@@ -2532,7 +2521,6 @@ trait Applications extends Compatibility {
2532
2521
if t.exists && alt.symbol.exists then
2533
2522
val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
2534
2523
val mappedSym = alt.symbol.asTerm.copy(info = t)
2535
- mappedSym.annotations = alt.symbol.annotations
2536
2524
mappedSym.rawParamss = trimmed
2537
2525
val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match
2538
2526
case Some ((pre, prevSkipped)) =>
0 commit comments