Spurious errors when compiling nested stuck lambdas

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Resolved: