groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (GROOVY-8195) CompileStatic fails to infer correct type when using elvis operator
Date Thu, 26 Jul 2018 04:45:00 GMT

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

Paul King closed GROOVY-8195.
-----------------------------

> CompileStatic fails to infer correct type when using elvis operator
> -------------------------------------------------------------------
>
>                 Key: GROOVY-8195
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8195
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.4.9
>            Reporter: Richard Zhang
>            Assignee: John Wagenleitner
>            Priority: Major
>             Fix For: 2.4.13
>
>
> see the following example:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> def foo() {
>     Map<String, String> strongMap
>     Map<String, String> elvisMap = strongMap ?: [:] // won't compile
>     Map<String, String> initStrongMap = [:] // compiles ok
> }
> {code}



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

Mime
View raw message