@@ -1942,27 +1942,16 @@ trait Applications extends Compatibility {
1942
1942
def resolveOverloaded (alts : List [TermRef ], pt : Type )(using Context ): List [TermRef ] =
1943
1943
record(" resolveOverloaded" )
1944
1944
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
1946
1946
* section conforms to the expected type `resultType`? If `resultType`
1947
1947
* 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.
1951
1948
*/
1952
1949
def resultConforms (altSym : Symbol , altType : Type , resultType : Type )(using Context ): Boolean =
1953
1950
resultType.revealIgnored match {
1954
1951
case resultType : ValueType =>
1955
1952
altType.widen match {
1956
1953
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)
1966
1955
case _ => true
1967
1956
}
1968
1957
case _ => true
@@ -2308,7 +2297,6 @@ trait Applications extends Compatibility {
2308
2297
if t.exists && alt.symbol.exists then
2309
2298
val (trimmed, skipped) = trimParamss(t.stripPoly, alt.symbol.rawParamss)
2310
2299
val mappedSym = alt.symbol.asTerm.copy(info = t)
2311
- mappedSym.annotations = alt.symbol.annotations
2312
2300
mappedSym.rawParamss = trimmed
2313
2301
val (pre, totalSkipped) = mappedAltInfo(alt.symbol) match
2314
2302
case Some ((pre, prevSkipped)) =>
0 commit comments