src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java
changeset 57963 ed7eb20871c5
parent 55306 ea43db53de91
child 58679 9c3209ff7550
equal deleted inserted replaced
57962:4b436b5d1630 57963:ed7eb20871c5
   134     /**
   134     /**
   135      * Set the results of method attribution.
   135      * Set the results of method attribution.
   136      */
   136      */
   137     void setResult(JCExpression tree, Type type) {
   137     void setResult(JCExpression tree, Type type) {
   138         result = type;
   138         result = type;
   139         if (env.info.isSpeculative) {
   139         if (env.info.attributionMode == DeferredAttr.AttributionMode.SPECULATIVE) {
   140             //if we are in a speculative branch we can save the type in the tree itself
   140             //if we are in a speculative branch we can save the type in the tree itself
   141             //as there's no risk of polluting the original tree.
   141             //as there's no risk of polluting the original tree.
   142             tree.type = result;
   142             tree.type = result;
   143         }
   143         }
   144     }
   144     }
   363                         deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext) :
   363                         deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext) :
   364                         overloadCheck(resultInfo, deferredAttrContext);
   364                         overloadCheck(resultInfo, deferredAttrContext);
   365                 speculativeTypes.put(resultInfo, t);
   365                 speculativeTypes.put(resultInfo, t);
   366                 return t;
   366                 return t;
   367             } else {
   367             } else {
   368                 if (!env.info.isSpeculative) {
   368                 if (!env.info.attributionMode.isSpeculative) {
   369                     argumentTypeCache.remove(new UniquePos(dt.tree));
   369                     argumentTypeCache.remove(new UniquePos(dt.tree));
   370                 }
   370                 }
   371                 return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);
   371                 return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);
   372             }
   372             }
   373         }
   373         }