diff -r 4b436b5d1630 -r ed7eb20871c5 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java Fri Aug 30 10:44:06 2019 +0200 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java Fri Aug 30 12:24:16 2019 +0200 @@ -136,7 +136,7 @@ */ void setResult(JCExpression tree, Type type) { result = type; - if (env.info.isSpeculative) { + if (env.info.attributionMode == DeferredAttr.AttributionMode.SPECULATIVE) { //if we are in a speculative branch we can save the type in the tree itself //as there's no risk of polluting the original tree. tree.type = result; @@ -365,7 +365,7 @@ speculativeTypes.put(resultInfo, t); return t; } else { - if (!env.info.isSpeculative) { + if (!env.info.attributionMode.isSpeculative) { argumentTypeCache.remove(new UniquePos(dt.tree)); } return deferredAttr.basicCompleter.complete(dt, resultInfo, deferredAttrContext);