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

Support !instanceof flow typing for else case

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-1
    • None
    • 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

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: