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

inference: javac doesn't implement 18.2.5 correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8, 9
    • tools
    • b148
    • Verified

      This program fails to compile:

       interface CheckedSupplier<T extends Throwable, R> {
          R get() throws T;

          static <T extends Throwable, R> CheckedSupplier<T, R> checked(CheckedSupplier<T, R> checkedSupplier) {
              return checkedSupplier;
          }

          static void main(String[] args) {
              checked(() -> null).get();
          }
      }

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

              Created:
              Updated:
              Resolved: