Javac crashes when method is called on a type-variable receiver from lambda expression

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 8
    • Affects Version/s: 8, 8-repo-lambda
    • Component/s: tools
    • b100
    • Verified

      This code crashes javac

      import java.util.*;

      interface Predicate<T> {
         void m(T t);
      }

      interface Stream<T> {
         void forEach(Predicate<T> pt);
      }

       

      class Crash<U> {

          public void crash(U current, Stream<U> stream) {
              List<U> list3 = new ArrayList<>();

              stream.forEach(i -> list3.add(current.clone()));

          }

      }


            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: