groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8583) Fail to infer auto-return type from ternary operator
Date Sun, 03 Jun 2018 02:50:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499273#comment-16499273
] 

ASF GitHub Bot commented on GROOVY-8583:
----------------------------------------

GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/747

    GROOVY-8583: Fail to infer auto-return type from ternary operator

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy 8583-stc-ternary

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/747.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #747
    
----
commit 884ddeb4d9aca6c4a68f22f7fbd7ce2ab77f51f1
Author: John Wagenleitner <jwagenleitner@...>
Date:   2018-06-03T02:17:08Z

    GROOVY-8583: Fail to infer auto-return type from ternary operator

----


> Fail to infer auto-return type from ternary operator
> ----------------------------------------------------
>
>                 Key: GROOVY-8583
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8583
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>            Reporter: Daniel Sun
>            Priority: Minor
>
> {code:java}
> @groovy.transform.Field
> String x = "X"
> @groovy.transform.CompileStatic
> public List<String> getStrings() {
> 	x ? [x] : Collections.emptyList() // fail
>         // return x ? [x] : Collections.emptyList() // succeed with `return`
> }
> getStrings()
> {code}
> SEE GROOVY-7753



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message