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

Guards of constant value false are not permitted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 19
    • Fix Version/s: 19
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b24

      Description

      javac should produce a compile-time error for code like:
      ---
          switch (Object o) {
              case String s when false -> {}
              default -> {}
          }
      --

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abimpoudis Angelos Bimpoudis
              Reporter:
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: