Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8322810 Lambda expression types can't be classes
  3. JDK-8356106

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

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Delivered
    • Icon: P4 P4
    • 25
    • 25
    • 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

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

              Created:
              Updated:
              Resolved: