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