langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
changeset 18920 5111c1aa3ecd
parent 18917 33c954cf3825
parent 18730 95354d510139
child 19128 b7e4f087369e
equal deleted inserted replaced
18919:7d1f1448a9db 18920:5111c1aa3ecd
  2274             ((ClassType)c.type).supertype_field = types.createErrorType((ClassSymbol)st.tsym, Type.noType);
  2274             ((ClassType)c.type).supertype_field = types.createErrorType((ClassSymbol)st.tsym, Type.noType);
  2275         c.type = types.createErrorType(c, c.type);
  2275         c.type = types.createErrorType(c, c.type);
  2276         c.flags_field |= ACYCLIC;
  2276         c.flags_field |= ACYCLIC;
  2277     }
  2277     }
  2278 
  2278 
  2279     /**
       
  2280      * Check that functional interface methods would make sense when seen
       
  2281      * from the perspective of the implementing class
       
  2282      */
       
  2283     void checkFunctionalInterface(JCTree tree, Type funcInterface) {
       
  2284         ClassType c = new ClassType(Type.noType, List.<Type>nil(), null);
       
  2285         ClassSymbol csym = new ClassSymbol(0, names.empty, c, syms.noSymbol);
       
  2286         c.interfaces_field = List.of(types.removeWildcards(funcInterface));
       
  2287         c.supertype_field = syms.objectType;
       
  2288         c.tsym = csym;
       
  2289         csym.members_field = new Scope(csym);
       
  2290         Symbol descSym = types.findDescriptorSymbol(funcInterface.tsym);
       
  2291         Type descType = types.findDescriptorType(funcInterface);
       
  2292         csym.members_field.enter(new MethodSymbol(PUBLIC, descSym.name, descType, csym));
       
  2293         csym.completer = null;
       
  2294         checkImplementations(tree, csym, csym);
       
  2295     }
       
  2296 
       
  2297     /** Check that all methods which implement some
  2279     /** Check that all methods which implement some
  2298      *  method conform to the method they implement.
  2280      *  method conform to the method they implement.
  2299      *  @param tree         The class definition whose members are checked.
  2281      *  @param tree         The class definition whose members are checked.
  2300      */
  2282      */
  2301     void checkImplementations(JCClassDecl tree) {
  2283     void checkImplementations(JCClassDecl tree) {