langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
changeset 1791 d378f023c36d
parent 1538 3cbbc9424f43
child 2212 1d3dc0e0ba0c
equal deleted inserted replaced
1790:7182011ee8a6 1791:d378f023c36d
  1455             else {
  1455             else {
  1456                 localEnv.info.selectSuper = cdef != null;
  1456                 localEnv.info.selectSuper = cdef != null;
  1457                 localEnv.info.varArgs = false;
  1457                 localEnv.info.varArgs = false;
  1458                 tree.constructor = rs.resolveConstructor(
  1458                 tree.constructor = rs.resolveConstructor(
  1459                     tree.pos(), localEnv, clazztype, argtypes, typeargtypes);
  1459                     tree.pos(), localEnv, clazztype, argtypes, typeargtypes);
  1460                 Type ctorType = checkMethod(clazztype,
  1460                 tree.constructorType = checkMethod(clazztype,
  1461                                             tree.constructor,
  1461                                             tree.constructor,
  1462                                             localEnv,
  1462                                             localEnv,
  1463                                             tree.args,
  1463                                             tree.args,
  1464                                             argtypes,
  1464                                             argtypes,
  1465                                             typeargtypes,
  1465                                             typeargtypes,
  1466                                             localEnv.info.varArgs);
  1466                                             localEnv.info.varArgs);
  1467                 if (localEnv.info.varArgs)
  1467                 if (localEnv.info.varArgs)
  1468                     assert ctorType.isErroneous() || tree.varargsElement != null;
  1468                     assert tree.constructorType.isErroneous() || tree.varargsElement != null;
  1469             }
  1469             }
  1470 
  1470 
  1471             if (cdef != null) {
  1471             if (cdef != null) {
  1472                 // We are seeing an anonymous class instance creation.
  1472                 // We are seeing an anonymous class instance creation.
  1473                 // In this case, the class instance creation
  1473                 // In this case, the class instance creation
  1525                 Symbol sym = rs.resolveConstructor(
  1525                 Symbol sym = rs.resolveConstructor(
  1526                     tree.pos(), localEnv, clazztype, argtypes,
  1526                     tree.pos(), localEnv, clazztype, argtypes,
  1527                     typeargtypes, true, tree.varargsElement != null);
  1527                     typeargtypes, true, tree.varargsElement != null);
  1528                 assert sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous();
  1528                 assert sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous();
  1529                 tree.constructor = sym;
  1529                 tree.constructor = sym;
       
  1530                 tree.constructorType = checkMethod(clazztype,
       
  1531                                             tree.constructor,
       
  1532                                             localEnv,
       
  1533                                             tree.args,
       
  1534                                             argtypes,
       
  1535                                             typeargtypes,
       
  1536                                             localEnv.info.varArgs);
  1530             }
  1537             }
  1531 
  1538 
  1532             if (tree.constructor != null && tree.constructor.kind == MTH)
  1539             if (tree.constructor != null && tree.constructor.kind == MTH)
  1533                 owntype = clazztype;
  1540                 owntype = clazztype;
  1534         }
  1541         }