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) { |