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

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

    XMLWordPrintable

Details

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

    Description

      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()));

          }

      }


      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: