Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8412

Support !instanceof flow typing for else case

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      maybeFile instanceof File ? maybeFile.canonicalPath : maybeFile.toString() sees maybeFile as type File in the true expression. However, !(maybeFile instanceof File) ? maybeFile.toString() : maybeFile.canonicalPath does not offer the same support for the else expression. The same applies if either were written long-form with if/else.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                emilles Eric Milles
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: