groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mauro Molinari (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-5734) Ternary operator returning null fails with static type checking
Date Fri, 17 Jul 2015 07:14:05 GMT

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

Mauro Molinari commented on GROOVY-5734:
----------------------------------------

Hi Cédric, I created GROOVY-7507. It fails even if {{Foo}} is written in Groovy instead of
Java.

> Ternary operator returning null fails with static type checking
> ---------------------------------------------------------------
>
>                 Key: GROOVY-5734
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5734
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.0.4
>            Reporter: Rodolfo Cruz
>            Assignee: Cédric Champeau
>             Fix For: 2.0.6
>
>         Attachments: someMethod.groovy
>
>
> If I define:
> {code}
> @groovy.transform.CompileStatic
> Integer someMethod() {
>     (false) ? null : 8
> }
> {code}
> this throws the following error:
> [Static type checking] - Cannot return value of type java.lang.Object on method returning
type java.lang.Integer -> java.lang.Integer 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message