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

changeset 1955
ec77c7b46c37
parent 1946
af80273f630a
child 1958
389eaf6ed973
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Aug 16 10:32:42 2013 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Aug 15 22:33:43 2013 +0200
     1.3 @@ -2607,8 +2607,7 @@
     1.4          * are compatible with the expected functional interface descriptor. This means that:
     1.5          * (i) parameter types must be identical to those of the target descriptor; (ii) return
     1.6          * types must be compatible with the return type of the expected descriptor;
     1.7 -        * (iii) thrown types must be 'included' in the thrown types list of the expected
     1.8 -        * descriptor.
     1.9 +        * (iii) finish inference of thrown types if required.
    1.10          */
    1.11          private void checkLambdaCompatible(JCLambda tree, Type descriptor, CheckContext checkContext, boolean speculativeAttr) {
    1.12              Type returnType = checkContext.inferenceContext().asFree(descriptor.getReturnType());
    1.13 @@ -2630,9 +2629,7 @@
    1.14  
    1.15              if (!speculativeAttr) {
    1.16                  List<Type> thrownTypes = checkContext.inferenceContext().asFree(descriptor.getThrownTypes());
    1.17 -                if (chk.unhandled(tree.inferredThrownTypes == null ? List.<Type>nil() : tree.inferredThrownTypes, thrownTypes).nonEmpty()) {
    1.18 -                    log.error(tree, "incompatible.thrown.types.in.lambda", tree.inferredThrownTypes);
    1.19 -                }
    1.20 +                chk.unhandled(tree.inferredThrownTypes == null ? List.<Type>nil() : tree.inferredThrownTypes, thrownTypes);
    1.21              }
    1.22          }
    1.23  

mercurial