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

changeset 1843
be62183f938a
parent 1826
9851071b551a
child 1844
29dcd6715b04
equal deleted inserted replaced
1841:792c40d5185a 1843:be62183f938a
2265 ((ClassType)c.type).supertype_field = types.createErrorType((ClassSymbol)st.tsym, Type.noType); 2265 ((ClassType)c.type).supertype_field = types.createErrorType((ClassSymbol)st.tsym, Type.noType);
2266 c.type = types.createErrorType(c, c.type); 2266 c.type = types.createErrorType(c, c.type);
2267 c.flags_field |= ACYCLIC; 2267 c.flags_field |= ACYCLIC;
2268 } 2268 }
2269 2269
2270 /**
2271 * Check that functional interface methods would make sense when seen
2272 * from the perspective of the implementing class
2273 */
2274 void checkFunctionalInterface(JCTree tree, Type funcInterface) {
2275 ClassType c = new ClassType(Type.noType, List.<Type>nil(), null);
2276 ClassSymbol csym = new ClassSymbol(0, names.empty, c, syms.noSymbol);
2277 c.interfaces_field = List.of(types.removeWildcards(funcInterface));
2278 c.supertype_field = syms.objectType;
2279 c.tsym = csym;
2280 csym.members_field = new Scope(csym);
2281 Symbol descSym = types.findDescriptorSymbol(funcInterface.tsym);
2282 Type descType = types.findDescriptorType(funcInterface);
2283 csym.members_field.enter(new MethodSymbol(PUBLIC, descSym.name, descType, csym));
2284 csym.completer = null;
2285 checkImplementations(tree, csym, csym);
2286 }
2287
2270 /** Check that all methods which implement some 2288 /** Check that all methods which implement some
2271 * method conform to the method they implement. 2289 * method conform to the method they implement.
2272 * @param tree The class definition whose members are checked. 2290 * @param tree The class definition whose members are checked.
2273 */ 2291 */
2274 void checkImplementations(JCClassDecl tree) { 2292 void checkImplementations(JCClassDecl tree) {

mercurial