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

Inference: stuck expressions should not be considered ahead of target-type constraints evaluation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8-pool, 9
    • Fix Version/s: tbd_major
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      8

      Description

      The following program should fail to compile but it doesn't:

      import java.util.*;
      import java.util.function.*;

      class ObjectTargetType {

      <T, R> R m(List<? extends R> l1, List<? extends R> l2, Function<String, R> fun) {
          return fun.apply(null);
      }

      void test(List<Class<RuntimeException>> l1, List<Class<Exception>> l2) {
          Object o = m(l1, l2, s -> String.class); // error???
      }

      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dlsmith Dan Smith
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: