diff -r dcd12fa5b58a -r 0caab0d65a04 src/share/classes/com/sun/tools/javac/comp/Attr.java --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Nov 12 21:20:49 2015 +0000 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Thu Nov 12 22:10:46 2015 +0000 @@ -662,8 +662,8 @@ /** Attribute the arguments in a method call, returning the method kind. */ - int attribArgs(List trees, Env env, ListBuffer argtypes) { - int kind = VAL; + int attribArgs(int initialKind, List trees, Env env, ListBuffer argtypes) { + int kind = initialKind; for (JCExpression arg : trees) { Type argtype; if (allowPoly && deferredAttr.isDeferred(env, arg)) { @@ -1739,7 +1739,7 @@ localEnv.info.isSelfCall = true; // Attribute arguments, yielding list of argument types. - attribArgs(tree.args, localEnv, argtypesBuf); + int kind = attribArgs(MTH, tree.args, localEnv, argtypesBuf); argtypes = argtypesBuf.toList(); typeargtypes = attribTypes(tree.typeargs, localEnv); @@ -1804,7 +1804,7 @@ // ...and check that it is legal in the current context. // (this will also set the tree's type) Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes); - checkId(tree.meth, site, sym, localEnv, new ResultInfo(MTH, mpt)); + checkId(tree.meth, site, sym, localEnv, new ResultInfo(kind, mpt)); } // Otherwise, `site' is an error type and we do nothing } @@ -1812,7 +1812,7 @@ } else { // Otherwise, we are seeing a regular method call. // Attribute the arguments, yielding list of argument types, ... - int kind = attribArgs(tree.args, localEnv, argtypesBuf); + int kind = attribArgs(VAL, tree.args, localEnv, argtypesBuf); argtypes = argtypesBuf.toList(); typeargtypes = attribAnyTypes(tree.typeargs, localEnv); @@ -1994,7 +1994,7 @@ // Attribute constructor arguments. ListBuffer argtypesBuf = new ListBuffer<>(); - int pkind = attribArgs(tree.args, localEnv, argtypesBuf); + int pkind = attribArgs(VAL, tree.args, localEnv, argtypesBuf); List argtypes = argtypesBuf.toList(); List typeargtypes = attribTypes(tree.typeargs, localEnv);