You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/11/27 20:12:00 UTC

[jira] [Resolved] (GROOVY-8412) Support !instanceof flow typing for else case

     [ https://issues.apache.org/jira/browse/GROOVY-8412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles resolved GROOVY-8412.
---------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/f348e50481c24f21413c4d2b52b501b433003051

> Support !instanceof flow typing for else case
> ---------------------------------------------
>
>                 Key: GROOVY-8412
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8412
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 5.0.0-alpha-1
>
>
> {{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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)