--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Tue Jun 18 20:56:04 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Wed Jun 19 11:48:05 2013 +0100
@@ -2267,6 +2267,24 @@
c.flags_field |= ACYCLIC;
}
+ /**
+ * Check that functional interface methods would make sense when seen
+ * from the perspective of the implementing class
+ */
+ void checkFunctionalInterface(JCTree tree, Type funcInterface) {
+ ClassType c = new ClassType(Type.noType, List.<Type>nil(), null);
+ ClassSymbol csym = new ClassSymbol(0, names.empty, c, syms.noSymbol);
+ c.interfaces_field = List.of(types.removeWildcards(funcInterface));
+ c.supertype_field = syms.objectType;
+ c.tsym = csym;
+ csym.members_field = new Scope(csym);
+ Symbol descSym = types.findDescriptorSymbol(funcInterface.tsym);
+ Type descType = types.findDescriptorType(funcInterface);
+ csym.members_field.enter(new MethodSymbol(PUBLIC, descSym.name, descType, csym));
+ csym.completer = null;
+ checkImplementations(tree, csym, csym);
+ }
+
/** Check that all methods which implement some
* method conform to the method they implement.
* @param tree The class definition whose members are checked.