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

Spurious errors when compiling nested stuck lambdas

    XMLWordPrintable

Details

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

    Description

      interface Function<X, Y> {
        Y apply(X x);
      }

      class Test {
        <T> void g(Function<String, T> f) { }
        <U> String m(U u, Function<U, U> fuu) { return null; }

        void test() {
           g(x->m("", i->(String)x));
        }
      }

      This reports the following error:

      Test.java:586: error: unexpected type
           g(x->m("", i->(String)i));
                                 ^
        required: value
        found: class

      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: