--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Thu May 24 14:35:32 2018 +0530
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Thu May 24 11:13:42 2018 +0100
@@ -883,8 +883,9 @@
Check.CheckContext checkContext = resultInfo.checkContext;
Type pt = resultInfo.pt;
if (!inferenceContext.inferencevars.contains(pt)) {
+ Type descriptor = null;
try {
- types.findDescriptorType(pt);
+ descriptor = types.findDescriptorType(pt);
} catch (Types.FunctionDescriptorLookupError ex) {
checkContext.report(null, ex.getDiagnostic());
}
@@ -893,14 +894,14 @@
exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
attr.memberReferenceQualifierResult(tree), argumentAttr.withLocalCacheContext());
ListBuffer<Type> argtypes = new ListBuffer<>();
- for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
+ for (Type t : descriptor.getParameterTypes()) {
argtypes.append(Type.noType);
}
JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree);
mref2.expr = exprTree;
Symbol lookupSym =
rs.resolveMemberReference(localEnv, mref2, exprTree.type,
- tree.name, argtypes.toList(), List.nil(), rs.arityMethodCheck,
+ tree.name, argtypes.toList(), List.nil(), descriptor, rs.arityMethodCheck,
inferenceContext, rs.structuralReferenceChooser).fst;
switch (lookupSym.kind) {
case WRONG_MTH: