[ https://issues.apache.org/jira/browse/GROOVY-7631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14962651#comment-14962651 ]
ASF GitHub Bot commented on GROOVY-7631: ---------------------------------------- GitHub user shils opened a pull request: https://github.com/apache/incubator-groovy/pull/148 GROOVY-7631 If p is a primitive value, p != null returns false when s… …tatically compiled You can merge this pull request into a Git repository by running: $ git pull https://github.com/shils/incubator-groovy GROOVY-7631 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-groovy/pull/148.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 #148 ---- commit ba4d8997fe9de2c9454748b8f247b64828477b02 Author: Shil S <shil.si...@gmail.com> Date: 2015-10-18T22:09:05Z GROOVY-7631 If p is a primitive value, p != null returns false when statically compiled ---- > @CompileStatic compiles 0 != null to false > ------------------------------------------ > > Key: GROOVY-7631 > URL: https://issues.apache.org/jira/browse/GROOVY-7631 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 2.4.5 > Reporter: Kevin Gu > Assignee: Cédric Champeau > > import groovy.transform.*; > // @CompileStatic > class Bug { > void exec() { > println 0 != null > } > } > new Bug().exec() > The above code prints "true". But when @CompileStatic is umcommented, it > prints "false". -- This message was sent by Atlassian JIRA (v6.3.4#6332)