src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 3002
0caab0d65a04
parent 3001
dcd12fa5b58a
child 3092
8c3890c90147
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Nov 12 21:20:49 2015 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Nov 12 22:10:46 2015 +0000
     1.3 @@ -662,8 +662,8 @@
     1.4  
     1.5      /** Attribute the arguments in a method call, returning the method kind.
     1.6       */
     1.7 -    int attribArgs(List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
     1.8 -        int kind = VAL;
     1.9 +    int attribArgs(int initialKind, List<JCExpression> trees, Env<AttrContext> env, ListBuffer<Type> argtypes) {
    1.10 +        int kind = initialKind;
    1.11          for (JCExpression arg : trees) {
    1.12              Type argtype;
    1.13              if (allowPoly && deferredAttr.isDeferred(env, arg)) {
    1.14 @@ -1739,7 +1739,7 @@
    1.15                  localEnv.info.isSelfCall = true;
    1.16  
    1.17                  // Attribute arguments, yielding list of argument types.
    1.18 -                attribArgs(tree.args, localEnv, argtypesBuf);
    1.19 +                int kind = attribArgs(MTH, tree.args, localEnv, argtypesBuf);
    1.20                  argtypes = argtypesBuf.toList();
    1.21                  typeargtypes = attribTypes(tree.typeargs, localEnv);
    1.22  
    1.23 @@ -1804,7 +1804,7 @@
    1.24                      // ...and check that it is legal in the current context.
    1.25                      // (this will also set the tree's type)
    1.26                      Type mpt = newMethodTemplate(resultInfo.pt, argtypes, typeargtypes);
    1.27 -                    checkId(tree.meth, site, sym, localEnv, new ResultInfo(MTH, mpt));
    1.28 +                    checkId(tree.meth, site, sym, localEnv, new ResultInfo(kind, mpt));
    1.29                  }
    1.30                  // Otherwise, `site' is an error type and we do nothing
    1.31              }
    1.32 @@ -1812,7 +1812,7 @@
    1.33          } else {
    1.34              // Otherwise, we are seeing a regular method call.
    1.35              // Attribute the arguments, yielding list of argument types, ...
    1.36 -            int kind = attribArgs(tree.args, localEnv, argtypesBuf);
    1.37 +            int kind = attribArgs(VAL, tree.args, localEnv, argtypesBuf);
    1.38              argtypes = argtypesBuf.toList();
    1.39              typeargtypes = attribAnyTypes(tree.typeargs, localEnv);
    1.40  
    1.41 @@ -1994,7 +1994,7 @@
    1.42  
    1.43          // Attribute constructor arguments.
    1.44          ListBuffer<Type> argtypesBuf = new ListBuffer<>();
    1.45 -        int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
    1.46 +        int pkind = attribArgs(VAL, tree.args, localEnv, argtypesBuf);
    1.47          List<Type> argtypes = argtypesBuf.toList();
    1.48          List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
    1.49  

mercurial