@@ -2119,27 +2119,16 @@ trait Applications extends Compatibility {
2119
2119
def resolveOverloaded (alts : List [TermRef ], pt : Type )(using Context ): List [TermRef ] =
2120
2120
record(" resolveOverloaded" )
2121
2121
2122
- /** Is `alt` a method or polytype whose approximated result type after the first value parameter
2122
+ /** Is `alt` a method or polytype whose result type after the first value parameter
2123
2123
* section conforms to the expected type `resultType`? If `resultType`
2124
2124
* is a `IgnoredProto`, pick the underlying type instead.
2125
- *
2126
- * Using an approximated result type is necessary to avoid false negatives
2127
- * due to incomplete type inference such as in tests/pos/i21410.scala and tests/pos/i21410b.scala.
2128
2125
*/
2129
2126
def resultConforms (altSym : Symbol , altType : Type , resultType : Type )(using Context ): Boolean =
2130
2127
resultType.revealIgnored match {
2131
2128
case resultType : ValueType =>
2132
2129
altType.widen match {
2133
- case tp : PolyType => resultConforms(altSym, tp.resultType, resultType)
2134
- case tp : MethodType =>
2135
- val wildRes = wildApprox(tp.resultType)
2136
-
2137
- class ResultApprox extends AvoidWildcardsMap :
2138
- // Avoid false negatives by approximating to a lower bound
2139
- variance = - 1
2140
-
2141
- val approx = ResultApprox ()(wildRes)
2142
- constrainResult(altSym, approx, resultType)
2130
+ case tp : PolyType => resultConforms(altSym, instantiateWithTypeVars(tp), resultType)
2131
+ case tp : MethodType => constrainResult(altSym, tp.resultType, resultType)
2143
2132
case _ => true
2144
2133
}
2145
2134
case _ => true
@@ -2511,7 +2500,6 @@ trait Applications extends Compatibility {
2511
2500
if t.exists && alt.symbol.exists then
2512
2501
val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
2513
2502
val mappedSym = alt.symbol.asTerm.copy(info = t)
2514
- mappedSym.annotations = alt.symbol.annotations
2515
2503
mappedSym.rawParamss = trimmed
2516
2504
val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match
2517
2505
case Some ((pre, prevSkipped)) =>
0 commit comments