@@ -943,18 +943,16 @@ trait Applications extends Compatibility {
943943 // being infinitely overloaded, with each individual overload only
944944 // being brought into existence as needed
945945 val originalResultType = funRef.symbol.info.resultType.stripNull
946- val expectedResultType = AvoidWildcardsMap ()(proto.deepenProto.resultType)
947946 val resultType =
948947 if ! originalResultType.isRef(defn.ObjectClass ) then originalResultType
949- else if isFullyDefined(expectedResultType, ForceDegree .all) then expectedResultType
950- else expectedResultType match
948+ else AvoidWildcardsMap ()(proto.resultType.deepenProtoTrans) match
951949 case SelectionProto (nme.asInstanceOf_, PolyProto (_, resTp), _, _) => resTp
950+ case resTp if isFullyDefined(resTp, ForceDegree .all) => resTp
952951 case _ => defn.ObjectType
953- val info = MethodType (proto.typedArgs().map(_.tpe.widen), resultType)
954- val sym2 = funRef.symbol.copy(info = info ) // not entered, to avoid overload resolution problems
952+ val methType = MethodType (proto.typedArgs().map(_.tpe.widen), resultType)
953+ val sym2 = funRef.symbol.copy(info = methType ) // symbol not entered, to avoid overload resolution problems
955954 val fun2 = fun1.withType(sym2.termRef)
956- val app = simpleApply(fun2, proto)
957- Typed (app, TypeTree (resultType))
955+ simpleApply(fun2, proto)
958956 case funRef : TermRef =>
959957 val app = ApplyTo (tree, fun1, funRef, proto, pt)
960958 convertNewGenericArray(
0 commit comments