You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "John Wagenleitner (JIRA)" <ji...@apache.org> on 2017/08/24 20:07:00 UTC
[jira] [Updated] (GROOVY-8195) CompileStatic fails to infer correct
type when using elvis operator
[ https://issues.apache.org/jira/browse/GROOVY-8195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Wagenleitner updated GROOVY-8195:
--------------------------------------
Component/s: Static Type Checker
> 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
>
> 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
(v6.4.14#64029)