Release Note: The javac Compiler Should Not Accept a Lambda Expression Type to Be a Class

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: tools

      Prior to JDK 25, the `javac` compiler was allowing the type of lambda expressions to be classes in some cases. This implies that the `javac` compiler was accepting code like:

      ```
          class Test {
              void m() {
                  Test r = (Test & Runnable) () -> System.out.println("Hello, World!");
              }
          }
      ```

      Starting from JDK 25 the `javac` compiler will reject lambda expressions which type is a class

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: