Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8011376

Spurious checked exception errors in nested method call

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8, 8-repo-lambda
    • tools
    • b87
    • Verified

      The following program does not compile:

      import java.util.*;

      class Test {
      Callable<Number> tasks = id(id(()->{ if (true) throw new java.io.IOException(); else return 0; }));

      <Z> Z id(Z z) { return null; }

      }


      However, if the outer 'id' call is removed, the program compiles.

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: