langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
changeset 45498 0848a6cbe2a3
parent 44571 1140b8dad6bb
child 45504 ea7475564d07
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java	Thu Jun 08 00:11:29 2017 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java	Fri Jun 09 11:27:03 2017 -0700
@@ -556,19 +556,16 @@
         Type overloadCheck(ResultInfo resultInfo, DeferredAttrContext deferredAttrContext) {
             Type mtype = methodType();
             ResultInfo localInfo = resultInfo(resultInfo);
+            Type t;
             if (mtype != null && mtype.hasTag(METHOD) && mtype.isPartial()) {
-                Type t = ((PartiallyInferredMethodType)mtype).check(localInfo);
-                if (!deferredAttrContext.inferenceContext.free(localInfo.pt)) {
-                    speculativeTypes.put(localInfo, t);
-                    return localInfo.check(tree.pos(), t);
-                } else {
-                    return t;
-                }
+                //poly invocation
+                t = ((PartiallyInferredMethodType)mtype).check(localInfo);
             } else {
-                Type t = localInfo.check(tree.pos(), speculativeTree.type);
-                speculativeTypes.put(localInfo, t);
-                return t;
+                //standalone invocation
+                t = localInfo.check(tree.pos(), speculativeTree.type);
             }
+            speculativeTypes.put(localInfo, t);
+            return t;
         }
 
         /**