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

JShell should support declaring variables using pattern matching

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • 24
    • tools
    • None

      Using notation like:
      ---
      o instanceof String s
      //s declared here iff the above evaluates to true
      ---

      or possibly
      ---
      if (!(o instanceof String s)) throw new IllegalStateException();
      //s declared here iff the above didn't throw an exception
      ---

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: